├── .gitattributes ├── .github └── workflows │ ├── codeql.yml │ ├── continuous-integration-workflow.yml │ └── documentation-workflow.yml ├── .gitmodules ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── ChangeLog ├── Changes.taendl ├── FAQ ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.WIN32 ├── TODO ├── aclocal.m4 ├── appveyor.yml ├── bin ├── Makefile.am ├── Makefile.in └── dime-config ├── build-tmake ├── common.pro ├── dime.pro ├── makefile └── release.pro ├── cfg ├── config.guess ├── config.sub ├── csubst.exe ├── depcomp ├── doxy4win.pl ├── errors.txt ├── gendsp.pl.in ├── gendsp.sh ├── gendsp.sh.in ├── install-sh ├── ltmain.sh ├── missing ├── mkinstalldirs ├── wrapmsvc.cpp └── wrapmsvc.exe ├── configure ├── configure.ac ├── contrib ├── README ├── dime.mcp └── dxf2vrml.mcp ├── dime-config.cmake.in ├── dime.cfg.in ├── dime.pc.cmake.in ├── dime.pc.in ├── dime.rc.cmake.in ├── docs ├── announcement-0_9.txt ├── dime.doxygen.awesome.cmake.in ├── dime.doxygen.cmake.in ├── dime.doxygen.in ├── doxygen │ ├── Coin_logo.png │ ├── footer.html │ ├── header.html │ └── stylesheet.css └── todo.txt ├── dxf2vrml ├── Makefile.am ├── Makefile.in ├── dxf2vrml.cpp └── makefile.generic ├── dxfsphere ├── Makefile.am ├── Makefile.in └── dxfsphere.cpp ├── html ├── Makefile.am └── Makefile.in ├── include ├── config.h.cmake.in ├── config.h.in └── dime │ ├── Base.h │ ├── Basic.h │ ├── Input.h │ ├── Layer.h │ ├── Model.h │ ├── Output.h │ ├── RecordHolder.h │ ├── State.h │ ├── classes │ ├── Class.h │ └── UnknownClass.h │ ├── convert │ ├── convert.h │ └── layerdata.h │ ├── entities │ ├── 3DFace.h │ ├── Arc.h │ ├── Block.h │ ├── Circle.h │ ├── Ellipse.h │ ├── Entity.h │ ├── ExtrusionEntity.h │ ├── FaceEntity.h │ ├── Insert.h │ ├── LWPolyline.h │ ├── Line.h │ ├── Point.h │ ├── Polyline.h │ ├── Solid.h │ ├── Spline.h │ ├── Text.h │ ├── Trace.h │ ├── UnknownEntity.h │ └── Vertex.h │ ├── objects │ ├── Object.h │ └── UnknownObject.h │ ├── records │ ├── DoubleRecord.h │ ├── FloatRecord.h │ ├── HexRecord.h │ ├── Int16Record.h │ ├── Int32Record.h │ ├── Int8Record.h │ ├── Record.h │ └── StringRecord.h │ ├── sections │ ├── BlocksSection.h │ ├── ClassesSection.h │ ├── EntitiesSection.h │ ├── HeaderSection.h │ ├── ObjectsSection.h │ ├── Section.h │ ├── TablesSection.h │ └── UnknownSection.h │ ├── tables │ ├── LayerTable.h │ ├── Table.h │ ├── TableEntry.h │ ├── UCSTable.h │ └── UnknownTable.h │ └── util │ ├── Array.h │ ├── BSPTree.h │ ├── Box.h │ ├── Dict.h │ ├── Linear.h │ └── MemHandler.h ├── src ├── Base.cpp ├── Basic.cpp ├── Input.cpp ├── Layer.cpp ├── Makefile.am ├── Makefile.in ├── Model.cpp ├── Output.cpp ├── RecordHolder.cpp ├── State.cpp ├── classes │ ├── Class.cpp │ ├── Makefile.am │ ├── Makefile.in │ └── UnknownClass.cpp ├── convert │ ├── 3dfaceconvert.cpp │ ├── Makefile.am │ ├── Makefile.in │ ├── arcconvert.cpp │ ├── circleconvert.cpp │ ├── convert.cpp │ ├── convert_funcs.h │ ├── ellipseconvert.cpp │ ├── layerdata.cpp │ ├── lineconvert.cpp │ ├── linesegment.cpp │ ├── linesegment.h │ ├── lwpolylineconvert.cpp │ ├── pointconvert.cpp │ ├── polylineconvert.cpp │ ├── solidconvert.cpp │ └── traceconvert.cpp ├── entities │ ├── 3DFace.cpp │ ├── Arc.cpp │ ├── Block.cpp │ ├── Circle.cpp │ ├── Ellipse.cpp │ ├── Entity.cpp │ ├── ExtrusionEntity.cpp │ ├── FaceEntity.cpp │ ├── Insert.cpp │ ├── LWPolyline.cpp │ ├── Line.cpp │ ├── Makefile.am │ ├── Makefile.in │ ├── Point.cpp │ ├── Polyline.cpp │ ├── Solid.cpp │ ├── Spline.cpp │ ├── Text.cpp │ ├── Trace.cpp │ ├── UnknownEntity.cpp │ └── Vertex.cpp ├── objects │ ├── Makefile.am │ ├── Makefile.in │ ├── Object.cpp │ └── UnknownObject.cpp ├── records │ ├── DoubleRecord.cpp │ ├── FloatRecord.cpp │ ├── HexRecord.cpp │ ├── Int16Record.cpp │ ├── Int32Record.cpp │ ├── Int8Record.cpp │ ├── Makefile.am │ ├── Makefile.in │ ├── Record.cpp │ └── StringRecord.cpp ├── sections │ ├── BlocksSection.cpp │ ├── ClassesSection.cpp │ ├── EntitiesSection.cpp │ ├── HeaderSection.cpp │ ├── Makefile.am │ ├── Makefile.in │ ├── ObjectsSection.cpp │ ├── Section.cpp │ ├── TablesSection.cpp │ └── UnknownSection.cpp ├── tables │ ├── LayerTable.cpp │ ├── Makefile.am │ ├── Makefile.in │ ├── Table.cpp │ ├── TableEntry.cpp │ ├── UCSTable.cpp │ └── UnknownTable.cpp └── util │ ├── Array.cpp │ ├── BSPTree.cpp │ ├── Box.cpp │ ├── Dict.cpp │ ├── Linear.cpp │ ├── Makefile.am │ ├── Makefile.in │ └── MemHandler.cpp └── testfiles ├── Bug1 ├── README.txt ├── testFile_Bug01.dxf ├── testFile_Bug01.wrl └── testFile_Bug01_original.wrl ├── Bug2 ├── README.txt ├── testFile_Bug02.dxf ├── testFile_Bug02.wrl └── testFile_Bug02_original.wrl ├── Bug3 ├── README.txt └── testFile_Bug03.dxf ├── Bug4 ├── README.txt ├── testFile_Bug04.dxf └── testFile_Bug04.wrl └── Bug5 ├── README.txt ├── testFile_Bug05.dxf └── testFile_Bug05.wrl /.gitattributes: -------------------------------------------------------------------------------- 1 | # Support GitHub linguist library to display right repository language 2 | configure linguist-generated 3 | configure.ac linguist-generated 4 | Makefile.in linguist-generated 5 | Makefile.am linguist-generated 6 | ltmain.sh linguist-generated 7 | install-sh linguist-generated 8 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | workflow_dispatch: # Allow manual triggers 5 | push: 6 | branches: [ "master" ] 7 | pull_request: 8 | branches: [ "master" ] 9 | schedule: 10 | - cron: '31 10 * * 4' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | #strategy: 22 | # fail-fast: false 23 | # matrix: 24 | # language: [ 'c-cpp', 'python' ] 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | with: 30 | submodules: recursive 31 | 32 | - name: Initialize CodeQL 33 | uses: github/codeql-action/init@v3 34 | with: 35 | languages: c-cpp 36 | config: | 37 | #disable-default-queries: true 38 | #queries: 39 | # - uses: security-and-quality 40 | query-filters: 41 | # Specifically hide the results of these queries. 42 | - exclude: 43 | id: cpp/assignment-does-not-return-this 44 | - exclude: 45 | id: cpp/fixme-comment 46 | - exclude: 47 | id: cpp/rule-of-two 48 | - exclude: 49 | id: cpp/use-of-goto 50 | #config-file: ./lgtm.yml 51 | 52 | #- name: Autobuild 53 | # uses: github/codeonfigureql-action/autobuild@v2 54 | 55 | - name: Create build with CMake 56 | run: cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir 57 | 58 | - name: Build project with CMake 59 | run: cmake --build cmake_build_dir --target all --config Release -- -j4 60 | 61 | - name: Perform CodeQL Analysis 62 | uses: github/codeql-action/analyze@v3 63 | with: 64 | category: "/language:c-cpp" 65 | -------------------------------------------------------------------------------- /.github/workflows/continuous-integration-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration Build 2 | 3 | on: 4 | pull_request: 5 | branches: [ master ] 6 | # push: 7 | # branches: [ master ] 8 | 9 | jobs: 10 | ubuntu-build: 11 | name: Ubuntu Build 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v4 16 | with: 17 | submodules: recursive 18 | - name: Create build directory and run CMake 19 | run: | 20 | cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir 21 | - name: Build project 22 | run: | 23 | cmake --build cmake_build_dir --target install --config Release -- -j4 24 | #- name: Run tests 25 | # run: ctest -C Release -VV 26 | # working-directory: cmake_build_dir 27 | - name: Create Artifacts 28 | uses: actions/upload-artifact@v4 29 | with: 30 | name: Ubuntu-Artifacts 31 | path: cmake_install_dir/ 32 | if: always() 33 | 34 | windows-build: 35 | name: Windows Build 36 | runs-on: windows-latest 37 | steps: 38 | - name: Checkout repository 39 | uses: actions/checkout@v4 40 | with: 41 | submodules: recursive 42 | - name: Create build directory and run CMake 43 | shell: cmd 44 | run: | 45 | cmake -S . -B cmake_build_dir -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir 46 | - name: Build project 47 | run: | 48 | cmake --build cmake_build_dir --target INSTALL --config Release -- /nologo /verbosity:minimal /maxcpucount:2 /property:MultiProcessorCompilation=true 49 | #- name: Run tests 50 | # run: ctest -C Release -VV 51 | # working-directory: cmake_build_dir 52 | - name: Create Artifacts 53 | uses: actions/upload-artifact@v4 54 | with: 55 | name: Windows-Artifacts 56 | path: cmake_install_dir/ 57 | if: always() 58 | 59 | macos-build: 60 | name: MacOS Build 61 | runs-on: macos-latest 62 | steps: 63 | - name: Checkout repository 64 | uses: actions/checkout@v4 65 | with: 66 | submodules: recursive 67 | - name: Create build directory and run CMake 68 | run: | 69 | cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir 70 | - name: Build project 71 | run: | 72 | cmake --build cmake_build_dir --target install --config Release -- -j4 73 | #- name: Run tests 74 | # run: ctest -C Release -VV 75 | # working-directory: cmake_build_dir 76 | - name: Create Artifacts 77 | uses: actions/upload-artifact@v4 78 | with: 79 | name: MacOS-Artifacts 80 | path: cmake_install_dir/ 81 | if: always() 82 | -------------------------------------------------------------------------------- /.github/workflows/documentation-workflow.yml: -------------------------------------------------------------------------------- 1 | name: Awesome Documentation Build 2 | 3 | on: 4 | workflow_dispatch: # Allow manual triggers 5 | push: 6 | branches: [ master ] 7 | 8 | jobs: 9 | ubuntu-build: 10 | name: Ubuntu Build 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | with: 16 | submodules: recursive 17 | - name: Create build directory and run CMake 18 | run: | 19 | curl -L -o doxygen-1.10.0.linux.bin.tar.gz https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz 20 | tar xzf doxygen-1.10.0.linux.bin.tar.gz 21 | export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH 22 | cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DDIME_BUILD_AWESOME_DOCUMENTATION=ON 23 | - name: Build project 24 | run: | 25 | export PATH=${{ github.workspace }}/doxygen-1.10.0/bin:$PATH 26 | doxygen --version 27 | cmake --build cmake_build_dir --target documentation_awesome --config Release -- -j4 28 | - name: Deploy Awesome Documentation to Github Pages 29 | uses: peaceiris/actions-gh-pages@v4 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | publish_dir: cmake_build_dir/html_awesome 33 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs/doxygen-awesome"] 2 | path = docs/doxygen-awesome 3 | url = https://github.com/coin3d/doxygen-awesome-css.git 4 | branch = coin3d 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | ======= 3 | 4 | Peder Blekken 5 | 6 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) Kongsberg Oil & Gas Technologies AS 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | The ChangeLog file is intentionally not updated in the repository as this 2 | information can be easily gathered through the revision control system. 3 | 4 | Upon release, don't forget to fill the ChangeLog file through e.g.: 5 | $ hg log --style=changelog -rtip: > ChangeLog 6 | 7 | (replace the optional token with the tag for the previous release) 8 | -------------------------------------------------------------------------------- /Changes.taendl: -------------------------------------------------------------------------------- 1 | 2 | 2012-07-27 Martin Taendl 3 | 4 | * src/convert/linesegment.cpp: 5 | intersect_line: 6 | checking also if the lines are almost parallel 7 | ==> see directory testfiles/Bug2 8 | 9 | 2012-07-21 Martin Taendl 10 | 11 | * src/convert/ellipseconvert.cpp: 12 | convert_ellipse: 13 | calculating size differently now, 14 | since in some cases the old way led to 15 | very small increments, so that conversion 16 | took very very long and needed a lot of memory 17 | ==> see directory testfiles/Bug5 18 | 19 | 2012-07-17 Martin Taendl 20 | 21 | * src/convert/polylineconvert.cpp: 22 | convert_line: 23 | handling negative bulge differently now, 24 | which I think was not treated correctly 25 | before 26 | ==> see directory testfiles/Bug1 27 | 28 | 29 | Open issues: 30 | 31 | - dxf2vrml exits with an error message if a "nan" is found 32 | in the dxf file. The error is o.k., but it would be nice 33 | if dime discards the entity and continues reading the file. 34 | ==> see directory testfiles/Bug3 35 | 36 | - inserts where the insert point has large coordinates 37 | appear "noisy"/distored because of the truncation error since 38 | the translation is performed using single precision float variables rather 39 | than double precision variables. 40 | ==> see directory testfiles/Bug4 41 | 42 | -------------------------------------------------------------------------------- /FAQ: -------------------------------------------------------------------------------- 1 | 2 | Question 1: Where are the rendering methods? 3 | ============================================ 4 | 5 | Short answer: 6 | 7 | Nowhere. 8 | 9 | Long answer: 10 | 11 | The dime library is mostly focused on supporting the DXF file format 12 | so you can exchange data with other 3D systems (e.g. AutoCAD) through 13 | it, and does not contain code for rendering the data. The intention 14 | of the library is that you should have some other retain-mode rendering 15 | library for 3D models, like Open Inventor, Optimizer, or Performer, 16 | and use dime to load DXF files and then move the geometry data into 17 | the library designed for rendering. If you want to save models using 18 | the DXF file format, you move the geometry data the other way. 19 | 20 | 21 | Question 2: What about support for other file formats? 22 | ====================================================== 23 | 24 | Short answer: 25 | 26 | Beta support for dxb has recently been added. For AutoCAD dwg support, 27 | see www.opendwg.org. 28 | 29 | Long answer: 30 | 31 | To support other file formats, the format must be structurally very 32 | similar to the AutoCAD .dxf file format. AutoCAD .dxb is one such 33 | format, but it is hardly used by anyone. The AutoCAD .dwg format 34 | could potensially be a candidate, but the file format seems too complex. 35 | Check out opendwg.org if you need support for .dwg files. 36 | 37 | Question 3: I get an error when running 'configure' with Cygwin. What's wrong? 38 | ============================================================================== 39 | 40 | Answer: 41 | 42 | # make sure c:\tmp exists 43 | export TEMP=c:\\tmp 44 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | if BUILD_HTMLPAGES 4 | HTMLDIR = html 5 | else 6 | HTMLDIR = 7 | endif 8 | 9 | DXF2VRMLDIR = dxf2vrml 10 | DXFSPHEREDIR = dxfsphere 11 | 12 | if BUILD_WITH_MSVC 13 | EXAMPLEPROGDIRS = 14 | else 15 | EXAMPLEPROGDIRS = $(DXF2VRMLDIR) $(DXFSPHEREDIR) 16 | endif 17 | 18 | if BUILD_LIBRARY 19 | SRCDIRS = src $(EXAMPLEPROGDIRS) 20 | else 21 | SRCDIRS = 22 | endif 23 | 24 | SUBDIRS = $(HTMLDIR) $(SRCDIRS) 25 | 26 | pkgconfigdir = $(libdir)/pkgconfig 27 | pkgconfig_DATA= dime.pc 28 | 29 | EXTRA_DIST = \ 30 | dime.pc.in \ 31 | cfg/errors.txt \ 32 | cfg/gendsp.pl.in \ 33 | cfg/ltconfig \ 34 | cfg/wrapmsvc.exe \ 35 | cfg/csubst.exe \ 36 | cfg/doxy4win.pl \ 37 | docs/dime.doxygen.in \ 38 | docs/doxygen/header.html \ 39 | docs/doxygen/footer.html \ 40 | docs/doxygen/stylesheet.css \ 41 | docs/doxygen/Coin_logo.png 42 | 43 | DISTCLEANFILES = \ 44 | dime.pc \ 45 | docs/dime.doxygen 46 | 47 | docs/dime.doxygen: $(srcdir)/docs/dime.doxygen.in config.status 48 | @if test -d docs; then :; else mkdir docs; fi 49 | @./config.status --file=$@:$@.in 50 | @$(srcdir)/cfg/doxy4win.pl docs/dime.doxygen 51 | 52 | doxygen-doc: built-sources 53 | if test x"@DIME_DOC_HTML@" = x"YES"; then \ 54 | mkdir -p "@dime_html_dir@"; \ 55 | else :; fi 56 | @sim_ac_doxygen_exe@ $(top_builddir)/docs/dime.doxygen 57 | 58 | doxygen-docs: built-sources 59 | if test x"@DIME_DOC_HTML@" = x"YES"; then \ 60 | mkdir -p "@dime_html_dir@"; \ 61 | else :; fi 62 | @sim_ac_doxygen_exe@ $(top_builddir)/docs/dime.doxygen 63 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | NEWS 2 | ==== 3 | 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README for DIME 2 | =============== 3 | 4 | DIME is a DXF (Data eXchange Format) file format support library. This 5 | file contains general information about the library. For compilation and 6 | installation information, refer to the file named INSTALL. For copyright 7 | information, refer to the file named COPYING. Changes in the library 8 | since the first public release (v0.9) are described in the file named 9 | ChangeLog. 10 | 11 | 12 | 0. CONTENTS 13 | =========== 14 | 15 | 1. FUNCTIONALITY 16 | 2. TECHNICAL SUPPORT 17 | 3. LICENSE INFORMATION 18 | 19 | 20 | 1. FUNCTIONALITY 21 | ================ 22 | 23 | DIME is a C++ class library for reading, constructing, manipulating, and 24 | writing DXF file data. The name is an acronym for DXF Import, Manipulation, 25 | and Export library. 26 | 27 | The focus of the library is primarily on loading DXF files and building 28 | a data structure containing the DXF data, and on saving such data structures 29 | as a file conforming to the DXF file format. The intended purpose for 30 | DIME was on importing and exporting DXF files. For this kind of usage, 31 | special memory management techniques can be used to boost the performance 32 | significantly. 33 | 34 | Aside from loading and saving the data structure, functionality is also 35 | provided for traversing the data structure while performing various tasks, 36 | and also some special functionality for extracting geometry from the DXF 37 | data structure. 38 | 39 | A sample program is included in the directory dxf2vrml/ which will convert 40 | a DXF file (only the polygon data) to a VRML file. 41 | 42 | 43 | 2. TECHNICAL SUPPORT 44 | ==================== 45 | 46 | Systems In Motion (SIM) has no obligation to provide technical support 47 | for the BSD licensed version of DIME. If resources permit, however, 48 | SIM will of course try to be as helpful as possible. 49 | 50 | SIM has set up two mailing lists for DIME support. 51 | 52 | dime-announce 53 | This mailing list is for announcements regarding DIME. New releases, 54 | new functionality, license information, this kind of stuff. 55 | This list is moderated (read-only). 56 | 57 | dime-discuss 58 | This mailing list is for discussing DIME. Technical support can be 59 | provided through this discussion forum. Followups to announcements 60 | in dime-announce should also be directed to this list. 61 | This list is open for posting for all subscribers. 62 | 63 | To subscribe to either of the two lists, send an email to SIM's mailing 64 | list manager at with a subject line with the format 65 | "subscribe ". To unsubscribe, use a subject line with the 66 | format "unsubscribe ". Do not include brackets around the 67 | mailing list name. For general information about SIM's mailing list 68 | manager, use "help" as the subject line. 69 | 70 | 71 | 3. LICENSE INFORMATION 72 | ====================== 73 | 74 | DIME is released publicly under the 3-clause BSD license (see the file named COPYING). 75 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | TODO for DIME 2 | 3 | Just to clarify something; the order of the items in the list and the 4 | priority we have given the items do not guarantee when (or even if) the 5 | items will be implemented. 6 | 7 | *) Upgrade configure setup and and DLLify library - make Mac OS X framework 8 | [top priority] 9 | 10 | *) Audit API and fix parts that are not safe in a Win32 environment 11 | where the client code uses a different C run-time than the Dime 12 | library 13 | [high priority] 14 | 15 | This is _extremely_ important to get done before 1.0 release, or 16 | we will fight support requests over this for the remaining life 17 | time of the library.. 18 | 19 | A few examples of stuff that needs to be fixed: 20 | 21 | - methods getting or returning FILE*, see for instance 22 | dimeInput / dimeOutput classes (setFileHandle() methods) 23 | 24 | - methods allocating memory that are made the client's 25 | responsibility to deallocate, see for instance the copy() 26 | methods of the entity classes 27 | 28 | - functions appending or removing items from dimeArray 29 | template objects passed in as arguments, or passing them out 30 | as return values 31 | 32 | (this causes alternate memory allocation / deallocation in 33 | client or library code, due to dimeArray being fully 34 | inlined) 35 | 36 | see for instance dimeCircle::extractGeometry() 37 | 38 | *) Write more and better doxygen documentation comments. 39 | [high priority] 40 | 41 | *) Make a more robust run-time type checking system. 42 | [high priority] 43 | - shouldn't require client apps to be recompiled if new types are added 44 | - maybe make it possible to override the "built-in" types 45 | - must be in place before v1.0 46 | 47 | *) Implement a (better) debug/warning/error system with callbacks 48 | [high priority] 49 | 50 | *) Implement more of the entities, tables, etc. used by AutoCAD 51 | [medium priority] 52 | 53 | *) implement some means of "seamless" integration with Coin 54 | [medium-low priority?] 55 | 56 | -------------------------------------------------------------------------------- /bin/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | # This has to be a separate subdir so bin/ won't be created in the 3 | # Mac OS X framework and coin-config won't be installed when you are not 4 | # building the library at all. 5 | 6 | dist_bin_SCRIPTS = coin-config 7 | 8 | -------------------------------------------------------------------------------- /build-tmake/dime.pro: -------------------------------------------------------------------------------- 1 | CONFIG += debug 2 | unix:CONFIG += sharedlib 3 | OBJECTS_DIR = objects 4 | -------------------------------------------------------------------------------- /build-tmake/makefile: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | # 3 | # Makefile for DIME: Dxf Import, Manipulation, and Export Library 4 | # 5 | # Usage: 6 | # make Makes Dime release version 7 | # make debug Makes Dime development version 8 | # 9 | #*************************************************************************** 10 | 11 | COPY = cp 12 | SYMLINK = ln -sf 13 | 14 | release: makefile.release .release 15 | 16 | debug: makefile.dime .dime 17 | 18 | objects: 19 | mkdir $@ 20 | 21 | releaseobjects: 22 | mkdir $@ 23 | 24 | .dime: objects 25 | @$(MAKE) -f makefile.dime 26 | 27 | makefile.dime: dime.pro common.pro 28 | tmake -o makefile.dime dime.pro common.pro 29 | 30 | .release: releaseobjects 31 | @$(MAKE) -f makefile.release 32 | 33 | makefile.release: release.pro common.pro 34 | tmake -o makefile.release release.pro common.pro 35 | 36 | clean: makefile.dime makefile.release 37 | @$(MAKE) -f makefile.dime clean 38 | @$(MAKE) -f makefile.release clean 39 | @$(RM) makefile.dime 40 | @$(RM) makefile.release 41 | -------------------------------------------------------------------------------- /build-tmake/release.pro: -------------------------------------------------------------------------------- 1 | CONFIG += release staticlib 2 | DEFINES += NDEBUG 3 | OBJECTS_DIR = releaseobjects 4 | -------------------------------------------------------------------------------- /cfg/csubst.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/dime/8cec48a1c27475f040f08a504ca0c59bd88a9d5b/cfg/csubst.exe -------------------------------------------------------------------------------- /cfg/doxy4win.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -p -i.bak 2 | 3 | sub cygpath { 4 | $path=`CYGWIN= cygpath -w "$_[0]"`; 5 | chop($path); 6 | $path; 7 | } 8 | 9 | s/\([^ ]*)/&cygpath($1)/eg; 10 | s/^HTML_OUTPUT.*/HTML_OUTPUT = html/; 11 | s/^MAN_OUTPUT.*/MAN_OUTPUT = man/; 12 | -------------------------------------------------------------------------------- /cfg/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | dirmode="" 9 | 10 | usage="\ 11 | Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." 12 | 13 | # process command line arguments 14 | while test $# -gt 0 ; do 15 | case $1 in 16 | -h | --help | --h*) # -h for help 17 | echo "$usage" 1>&2 18 | exit 0 19 | ;; 20 | -m) # -m PERM arg 21 | shift 22 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 23 | dirmode=$1 24 | shift 25 | ;; 26 | --) # stop option processing 27 | shift 28 | break 29 | ;; 30 | -*) # unknown option 31 | echo "$usage" 1>&2 32 | exit 1 33 | ;; 34 | *) # first non-opt arg 35 | break 36 | ;; 37 | esac 38 | done 39 | 40 | for file 41 | do 42 | if test -d "$file"; then 43 | shift 44 | else 45 | break 46 | fi 47 | done 48 | 49 | case $# in 50 | 0) exit 0 ;; 51 | esac 52 | 53 | case $dirmode in 54 | '') 55 | if mkdir -p -- . 2>/dev/null; then 56 | echo "mkdir -p -- $*" 57 | exec mkdir -p -- "$@" 58 | fi 59 | ;; 60 | *) 61 | if mkdir -m "$dirmode" -p -- . 2>/dev/null; then 62 | echo "mkdir -m $dirmode -p -- $*" 63 | exec mkdir -m "$dirmode" -p -- "$@" 64 | fi 65 | ;; 66 | esac 67 | 68 | for file 69 | do 70 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 71 | shift 72 | 73 | pathcomp= 74 | for d 75 | do 76 | pathcomp="$pathcomp$d" 77 | case $pathcomp in 78 | -*) pathcomp=./$pathcomp ;; 79 | esac 80 | 81 | if test ! -d "$pathcomp"; then 82 | echo "mkdir $pathcomp" 83 | 84 | mkdir "$pathcomp" || lasterr=$? 85 | 86 | if test ! -d "$pathcomp"; then 87 | errstatus=$lasterr 88 | else 89 | if test ! -z "$dirmode"; then 90 | echo "chmod $dirmode $pathcomp" 91 | lasterr="" 92 | chmod "$dirmode" "$pathcomp" || lasterr=$? 93 | 94 | if test ! -z "$lasterr"; then 95 | errstatus=$lasterr 96 | fi 97 | fi 98 | fi 99 | fi 100 | 101 | pathcomp="$pathcomp/" 102 | done 103 | done 104 | 105 | exit $errstatus 106 | 107 | # Local Variables: 108 | # mode: shell-script 109 | # sh-indentation: 2 110 | # End: 111 | # mkinstalldirs ends here 112 | -------------------------------------------------------------------------------- /cfg/wrapmsvc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/dime/8cec48a1c27475f040f08a504ca0c59bd88a9d5b/cfg/wrapmsvc.exe -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | This directory contains various contributions to dime. These files 2 | will not be maintained by us. Please contact the contributor if 3 | you have questins regarding these files. 4 | 5 | Michael Louka : 6 | dime.mcp - Metrowerks CodeWarrior project file for dime: 7 | dxf2vrml.mcp - Metrowerks CodeWarrior project file for dxf2vrml 8 | 9 | -------------------------------------------------------------------------------- /contrib/dime.mcp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/dime/8cec48a1c27475f040f08a504ca0c59bd88a9d5b/contrib/dime.mcp -------------------------------------------------------------------------------- /contrib/dxf2vrml.mcp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/dime/8cec48a1c27475f040f08a504ca0c59bd88a9d5b/contrib/dxf2vrml.mcp -------------------------------------------------------------------------------- /dime-config.cmake.in: -------------------------------------------------------------------------------- 1 | # CMake package configuration file for @PROJECT_NAME@ 2 | # 3 | # Defines the target "@PROJECT_NAME@::@PROJECT_NAME@" 4 | # 5 | # Add the following lines to your CMakeLists.txt to depend on @PROJECT_NAME@ 6 | # 7 | # find_package(@PROJECT_NAME@ REQUIRED) 8 | # target_link_libraries(my_target_name @PROJECT_NAME@::@PROJECT_NAME@) 9 | # 10 | # Additionally you may one of the following variables (or their corresponding 11 | # upper case version) that are also defined. 12 | # 13 | # @PROJECT_NAME@_COMPILE_DEFINITIONS 14 | # @PROJECT_NAME@_DEFINITIONS 15 | # @PROJECT_NAME@_INCLUDE_DIRS 16 | # @PROJECT_NAME@_INCLUDE_DIR 17 | # @PROJECT_NAME@_LIBRARY 18 | # @PROJECT_NAME@_LIBRARIES 19 | # @PROJECT_NAME@_LIBRARY_DIRS 20 | # @PROJECT_NAME@_LIBRARY_DIR 21 | # 22 | # However, in most cases using the @PROJECT_NAME@::@PROJECT_NAME@ target is sufficient, 23 | # and you won't need these variables. 24 | 25 | @PACKAGE_INIT@ 26 | 27 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME_LOWER@-export.cmake") 28 | 29 | get_property(@PROJECT_NAME@_COMPILE_DEFINITIONS TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_COMPILE_DEFINITIONS) 30 | foreach(_def ${@PROJECT_NAME@_COMPILE_DEFINITIONS}) 31 | list(APPEND @PROJECT_NAME@_DEFINITIONS -D${_def}) 32 | endforeach() 33 | 34 | set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@) 35 | 36 | get_property(@PROJECT_NAME@_INCLUDE_DIRS TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_INCLUDE_DIRECTORIES) 37 | set(@PROJECT_NAME@_INCLUDE_DIR ${@PROJECT_NAME@_INCLUDE_DIRS}) 38 | set(@PROJECT_NAME@_LIBRARY @PROJECT_NAME@::@PROJECT_NAME@) 39 | get_property(@PROJECT_NAME@_LIBRARIES TARGET @PROJECT_NAME@::@PROJECT_NAME@ PROPERTY INTERFACE_LINK_LIBRARIES) 40 | set(@PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::@PROJECT_NAME@ ${@PROJECT_NAME@_LIBRARIES}) 41 | 42 | set_and_check(@PROJECT_NAME@_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@") 43 | set(@PROJECT_NAME@_LIBRARY_DIR ${@PROJECT_NAME@_LIBRARY_DIRS}) 44 | 45 | # For backwards compatibility define upper case versions of output variables 46 | foreach(_var 47 | @PROJECT_NAME@_COMPILE_DEFINITIONS 48 | @PROJECT_NAME@_DEFINITIONS 49 | @PROJECT_NAME@_INCLUDE_DIRS 50 | @PROJECT_NAME@_INCLUDE_DIR 51 | @PROJECT_NAME@_LIBRARY 52 | @PROJECT_NAME@_LIBRARIES 53 | @PROJECT_NAME@_LIBRARY_DIRS 54 | @PROJECT_NAME@_LIBRARY_DIR 55 | @PROJECT_NAME@_VERSION 56 | ) 57 | string(TOUPPER ${_var} _uppercase_var) 58 | set(${_uppercase_var} ${${_var}}) 59 | endforeach() 60 | -------------------------------------------------------------------------------- /dime.cfg.in: -------------------------------------------------------------------------------- 1 | # prefix is determined in coin-config, making the package "movable" 2 | # prefix="@prefix@" 3 | host="@host@" 4 | exec_prefix="@exec_prefix@" 5 | version="@DIME_VERSION@" 6 | cflags="@DIME_EXTRA_CFLAGS@" 7 | cppflags="@DIME_EXTRA_CPPFLAGS@" 8 | cxxflags="@DIME_EXTRA_CXXFLAGS@" 9 | ldflags="@DIME_EXTRA_LDFLAGS@" 10 | libs="@DIME_EXTRA_LIBS@" 11 | msvcrt="@DIME_MSVC_LIBC@" 12 | datadir="@datadir@" 13 | # includedir="@dimeincludedir@" 14 | frameworkdir="@frameworkdir@" 15 | compiler="@DIME_COMPILER@" 16 | -------------------------------------------------------------------------------- /dime.pc.cmake.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | bindir=${exec_prefix}/bin 4 | libdir=${exec_prefix}/lib 5 | includedir=${prefix}/include 6 | datarootdir=${prefix}/share 7 | datadir=${datarootdir} 8 | docdir=${datarootdir}/doc/@PROJECT_NAME_LOWER@ 9 | infodir=${datarootdir}/info 10 | mandir=${datarootdir}/man 11 | htmldir=${docdir}/html 12 | 13 | Name: @PROJECT_NAME@ 14 | Description: A library for reading, constructing, manipulating, and writing DXF file data 15 | Version: @PROJECT_VERSION@ 16 | Requires: 17 | Conflicts: 18 | Libs: -L${libdir} -ldime @DIME_EXTRA_LDFLAGS@ @DIME_EXTRA_LIBS@ 19 | Cflags: -I${includedir} @DIME_EXTRA_CFLAGS@ @DIME_EXTRA_CPPFLAGS@ 20 | -------------------------------------------------------------------------------- /dime.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | datarootdir=@datarootdir@ 6 | datadir=${datarootdir} 7 | 8 | Name: Dime 9 | Description: library for reading, constructing, manipulating, and writing DXF file data 10 | Version: @VERSION@ 11 | Requires: 12 | Conflicts: 13 | Libs: -L${libdir} @DIME_EXTRA_LDFLAGS@ @DIME_EXTRA_LIBS@ 14 | Cflags: -I${includedir} @DIME_EXTRA_CFLAGS@ @DIME_EXTRA_CPPFLAGS@ 15 | 16 | dime_host="@host@" 17 | compiler=@DIME_COMPILER@ 18 | compiler_is_gcc=@ac_compiler_gnu@ 19 | frameworkdir=@frameworkdir@ 20 | msvcrt=@DIME_MSVC_LIBC@ 21 | -------------------------------------------------------------------------------- /dime.rc.cmake.in: -------------------------------------------------------------------------------- 1 | 1 TYPELIB "@PROJECT_NAME@.rc" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 5 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 6 | FILEFLAGSMASK 0x3fL 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x4L 13 | FILETYPE 0x2L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904e4" 19 | BEGIN 20 | VALUE "CompanyName", "Kongsberg Oil & Gas Technologies AS" 21 | VALUE "FileDescription", "A library for reading, constructing, manipulating, and writing DXF file data - www.github.com/coin3d/dime" 22 | VALUE "FileVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @DIME_BETA_VERSION@" 23 | VALUE "InternalName", "@PROJECT_NAME@" 24 | VALUE "LegalCopyright", "Copyright (c) @DIME_BUILD_YEAR@ Kongsberg Oil & Gas Technologies AS" 25 | #ifdef _DEBUG 26 | VALUE "OriginalFilename", "@PROJECT_NAME@@PROJECT_VERSION_MAJOR@d.dll" 27 | #else 28 | VALUE "OriginalFilename", "@PROJECT_NAME@@PROJECT_VERSION_MAJOR@.dll" 29 | #endif 30 | VALUE "ProductName", "dime" 31 | VALUE "ProductVersion","@PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, @DIME_BETA_VERSION@" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x409, 1252 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /docs/doxygen/Coin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coin3d/dime/8cec48a1c27475f040f08a504ca0c59bd88a9d5b/docs/doxygen/Coin_logo.png -------------------------------------------------------------------------------- /docs/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/doxygen/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $projectname: $title 9 | $title 10 | 11 | 12 | 13 | $treeview 14 | $search 15 | $mathjax 16 | 17 | $extrastylesheet 18 | 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | 27 | 30 | 33 | 37 | 38 | 39 |
28 | Coin Logo 29 | 31 | Coin3D is Free Software,
published under the BSD 3-clause license. 32 |
34 | https://coin3d.github.io
35 | https://www.kongsberg.com/en/kogt/
36 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/todo.txt: -------------------------------------------------------------------------------- 1 | * Request from Rob Campbell on dime-discuss: 2 | 3 | I know that ACIS SAT is a proprietary, unpublished format. 4 | But shouldn't it be possible to extract the SAT data from a 5 | DXF file created by AutoCAD and create a standalone SAT file 6 | from it? And, conversely, to split a SAT file into parts that 7 | can be put in a DXF file in the proper format? 8 | 9 | The specification of 7.0 is available at: 10 | http://www.spatial.com/services_support/support/Technical/docs.html?LV3=Y -------------------------------------------------------------------------------- /dxf2vrml/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | INCLUDES = -I$(top_srcdir)/include 4 | 5 | noinst_PROGRAMS = dxf2vrml 6 | 7 | dxf2vrml_SOURCES = dxf2vrml.cpp 8 | 9 | if BUILD_WITH_MSVC 10 | dxf2vrml_LDADD = $(top_builddir)/src/dime0.lib 11 | else 12 | dxf2vrml_LDADD = $(top_builddir)/src/libdime.la 13 | endif 14 | 15 | -------------------------------------------------------------------------------- /dxf2vrml/makefile.generic: -------------------------------------------------------------------------------- 1 | 2 | 3 | CC = g++ -I../include -DNDEBUG 4 | LD = g++ -L../build 5 | # LD = g++ -L../build-tmake 6 | 7 | LIBS = -ldime 8 | 9 | .SUFFIXES: .cpp .o 10 | 11 | all:: dxf2vrml 12 | 13 | clean:: 14 | @rm *.o dxf2vrml 15 | 16 | .cpp.o: 17 | $(CC) -c $< 18 | 19 | dxf2vrml: dxf2vrml.o 20 | $(LD) -o $@ $^ $(LIBS) 21 | 22 | -------------------------------------------------------------------------------- /dxfsphere/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | INCLUDES = -I$(top_srcdir)/include 4 | 5 | noinst_PROGRAMS = dxfsphere 6 | 7 | dxfsphere_SOURCES = dxfsphere.cpp 8 | 9 | if BUILD_WITH_MSVC 10 | dxfsphere_LDADD = $(top_builddir)/src/dime0.lib 11 | else 12 | dxfsphere_LDADD = $(top_builddir)/src/libdime.la 13 | endif 14 | 15 | -------------------------------------------------------------------------------- /html/Makefile.am: -------------------------------------------------------------------------------- 1 | # NOTES: 2 | # This Makefile.am relies on $(htmldir) being AC_SUBST'ed into place... 3 | 4 | if BUILD_HTMLPAGES 5 | 6 | # ************************************************************************** 7 | # build trickery 8 | 9 | $(top_builddir)/docs/dime.doxygen: $(top_srcdir)/docs/dime.doxygen.in $(top_builddir)/config.status 10 | @( cd $(top_builddir); $(MAKE) docs/dime.doxygen ) 11 | 12 | index.html: $(top_builddir)/docs/dime.doxygen 13 | @( cd ..; \ 14 | echo " $(sim_ac_doxygen_exe) docs/dime.doxygen"; \ 15 | "$(sim_ac_doxygen_exe)" docs/dime.doxygen ) 16 | 17 | filelist.txt: index.html 18 | @if cmp -s $(top_srcdir)/docs/doxygen/Coin_logo.png Coin_logo.png; then :; else \ 19 | echo " cp $(top_srcdir)/docs/doxygen/Coin_logo.png ."; \ 20 | cp $(top_srcdir)/docs/doxygen/Coin_logo.png .; \ 21 | fi 22 | @ls -1 | egrep '(\.html|\.png|\.gif|\.css|\.tag)$$' >filelist.txt 23 | 24 | all-local: filelist.txt 25 | 26 | install-data-local: install-html 27 | 28 | uninstall-local: uninstall-html 29 | 30 | install-html: filelist.txt 31 | @$(NORMAL_INSTALL) 32 | $(mkinstalldirs) $(DESTDIR)$(htmldir) 33 | @list="`cat filelist.txt`"; \ 34 | for file in $$list; do \ 35 | echo " $(INSTALL_DATA) $$file $(DESTDIR)$(htmldir)/$$file"; \ 36 | $(INSTALL_DATA) $$file "$(DESTDIR)$(htmldir)/$$file"; \ 37 | done 38 | 39 | uninstall-html: filelist.txt 40 | @$(NORMAL_UNINSTALL) 41 | @list="`cat filelist.txt`"; \ 42 | for file in $$list; do \ 43 | echo " rm -f $(DESTDIR)$(htmldir)/$$file"; \ 44 | rm -f "$(DESTDIR)$(htmldir)/$$file"; \ 45 | done 46 | @echo " rmdir $(DESTDIR)$(htmldir)"; \ 47 | rmdir $(DESTDIR)$(htmldir) 2>/dev/null; \ 48 | : 49 | 50 | endif -------------------------------------------------------------------------------- /include/config.h.cmake.in: -------------------------------------------------------------------------------- 1 | /* include/config.h. Generated from config.h.cmake.in by CMake. */ 2 | 3 | /* whether or not finite() is available */ 4 | #cmakedefine HAVE_FINITE 5 | 6 | /* whether or not fpclass() is available */ 7 | #cmakedefine HAVE_FPCLASS 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #cmakedefine HAVE_IEEEFP_H 1 11 | 12 | /* whether or not isinf() is available */ 13 | #cmakedefine HAVE_ISINF 14 | 15 | /* whether or not isnan() is available */ 16 | #cmakedefine HAVE_ISNAN 17 | 18 | /* whether or not _finite() is available */ 19 | #cmakedefine HAVE__FINITE 20 | 21 | /* whether or not _fpclass() is available */ 22 | #cmakedefine HAVE__FPCLASS 23 | 24 | /* whether or not _isnan() is available */ 25 | #cmakedefine HAVE__ISNAN 26 | 27 | /* Name of package */ 28 | #define PACKAGE "@PACKAGE@" 29 | 30 | /* Define to the address where bug reports for this package should be sent. */ 31 | #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" 32 | 33 | /* Define to the full name of this package. */ 34 | #define PACKAGE_NAME "@PACKAGE_NAME@" 35 | 36 | /* Define to the full name and version of this package. */ 37 | #define PACKAGE_STRING "@PACKAGE_STRING@" 38 | 39 | /* Define to the one symbol short name of this package. */ 40 | #define PACKAGE_TARNAME "@PACKAGE_TARNAME@" 41 | 42 | /* Define to the home page for this package. */ 43 | #define PACKAGE_URL "@PACKAGE_URL@" 44 | 45 | /* Define to the version of this package. */ 46 | #define PACKAGE_VERSION "@PACKAGE_VERSION@" 47 | 48 | /* Version number of package */ 49 | #define VERSION "@PACKAGE_VERSION@" 50 | -------------------------------------------------------------------------------- /include/config.h.in: -------------------------------------------------------------------------------- 1 | /* include/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* whether or not finite() is available */ 7 | #undef HAVE_FINITE 8 | 9 | /* whether or not fpclass() is available */ 10 | #undef HAVE_FPCLASS 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_IEEEFP_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* whether or not isinf() is available */ 19 | #undef HAVE_ISINF 20 | 21 | /* whether or not isnan() is available */ 22 | #undef HAVE_ISNAN 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_MEMORY_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDINT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STDLIB_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRINGS_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_STRING_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_STAT_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_TYPES_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_UNISTD_H 47 | 48 | /* whether or not _finite() is available */ 49 | #undef HAVE__FINITE 50 | 51 | /* whether or not _fpclass() is available */ 52 | #undef HAVE__FPCLASS 53 | 54 | /* whether or not _isnan() is available */ 55 | #undef HAVE__ISNAN 56 | 57 | /* Name of package */ 58 | #undef PACKAGE 59 | 60 | /* Define to the address where bug reports for this package should be sent. */ 61 | #undef PACKAGE_BUGREPORT 62 | 63 | /* Define to the full name of this package. */ 64 | #undef PACKAGE_NAME 65 | 66 | /* Define to the full name and version of this package. */ 67 | #undef PACKAGE_STRING 68 | 69 | /* Define to the one symbol short name of this package. */ 70 | #undef PACKAGE_TARNAME 71 | 72 | /* Define to the home page for this package. */ 73 | #undef PACKAGE_URL 74 | 75 | /* Define to the version of this package. */ 76 | #undef PACKAGE_VERSION 77 | 78 | /* Define to 1 if you have the ANSI C header files. */ 79 | #undef STDC_HEADERS 80 | 81 | /* Version number of package */ 82 | #undef VERSION 83 | -------------------------------------------------------------------------------- /include/dime/Output.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_OUTPUT_H 34 | #define DIME_OUTPUT_H 35 | 36 | #include 37 | #include 38 | 39 | class dimeModel; 40 | 41 | class DIME_DLL_API dimeOutput 42 | { 43 | public: 44 | dimeOutput(); 45 | ~dimeOutput(); 46 | 47 | void setCallback(const int numrecords, 48 | int (*cb)(float, void *), void *cbdata); 49 | bool setFileHandle(FILE *fp); 50 | bool setFilename(const char * const filename); 51 | void setBinary(const bool state = true); 52 | bool isBinary() const; 53 | 54 | bool writeHeader() {return true;} 55 | bool writeGroupCode(const int groupcode); 56 | bool writeInt8(const int8 val); 57 | bool writeInt16(const int16 val); 58 | bool writeInt32(const int32 val); 59 | bool writeFloat(const float val); 60 | bool writeDouble(const dxfdouble val); 61 | bool writeString(const char * const str); 62 | 63 | int getUniqueHandleId(); 64 | 65 | private: 66 | friend class dimeModel; 67 | dimeModel *model; 68 | FILE *fp; 69 | bool binary; 70 | 71 | int (*callback)(float, void*); 72 | void *callbackdata; 73 | int numrecords; 74 | int numwrites; 75 | bool aborted; 76 | bool didOpenFile; 77 | 78 | }; // class dimeOutput 79 | 80 | #endif // ! DIME_OUTPUT_H 81 | 82 | -------------------------------------------------------------------------------- /include/dime/State.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_STATE_H 34 | #define DIME_STATE_H 35 | 36 | #include 37 | 38 | class dimeInsert; 39 | 40 | class DIME_DLL_API dimeState 41 | { 42 | public: 43 | dimeState(const bool traversePolylineVertices, 44 | const bool explodeInserts); 45 | dimeState(const dimeState &st); 46 | 47 | const dimeMatrix &getMatrix() const; 48 | const dimeMatrix &getInvMatrix() const; 49 | void getMatrix(dimeMatrix &m) const; 50 | void setMatrix(const dimeMatrix &matrix); 51 | 52 | enum { 53 | TRAVERSE_POLYLINE_VERTICES = 0x1, 54 | EXPLODE_INSERTS = 0x2, 55 | // private flags 56 | PUBLIC_MASK = 0x7fff, 57 | PRIVATE_MASK = 0x8000, 58 | INVMATRIX_DIRTY = 0x8000 59 | }; 60 | 61 | void setFlags(const unsigned int flags); 62 | unsigned int getFlags() const; 63 | 64 | const dimeInsert *getCurrentInsert() const; 65 | 66 | private: 67 | friend class dimeInsert; 68 | dimeMatrix matrix; 69 | dimeMatrix invmatrix; // to speed up things... 70 | unsigned int flags; 71 | const dimeInsert *currentInsert; 72 | }; // class dimeState 73 | 74 | inline const dimeMatrix & 75 | dimeState::getMatrix() const { 76 | return this->matrix; 77 | } 78 | 79 | inline void 80 | dimeState::setFlags(const unsigned int flags) 81 | { 82 | this->flags = (this->flags & PRIVATE_MASK) | flags; 83 | } 84 | 85 | inline unsigned int 86 | dimeState::getFlags() const 87 | { 88 | return (this->flags & PUBLIC_MASK); 89 | } 90 | 91 | inline const dimeInsert * 92 | dimeState::getCurrentInsert() const 93 | { 94 | return this->currentInsert; 95 | } 96 | 97 | #endif // ! DIME_STATE_H 98 | 99 | -------------------------------------------------------------------------------- /include/dime/classes/UnknownClass.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UNKNOWNCLASS_H 34 | #define DIME_UNKNOWNCLASS_H 35 | 36 | #include 37 | 38 | class dimeMemHandler; 39 | 40 | class DIME_DLL_API dimeUnknownClass : public dimeClass 41 | { 42 | public: 43 | dimeUnknownClass(const char * const name, dimeMemHandler * const memhandler); 44 | virtual ~dimeUnknownClass(); 45 | 46 | virtual dimeClass *copy(dimeModel * const model) const; 47 | 48 | virtual const char *getDxfClassName() const; 49 | virtual bool write(dimeOutput * const out); 50 | virtual int typeId() const; 51 | virtual int countRecords() const; 52 | 53 | private: 54 | char *dxfClassName; 55 | 56 | }; // class dimeUnknownClass 57 | 58 | #endif // ! DIME_UNKNOWNCLASS_H 59 | 60 | -------------------------------------------------------------------------------- /include/dime/convert/layerdata.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef _DXF2VRML_LAYERDATA_H_ 34 | #define _DXF2VRML_LAYERDATA_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | class DIME_DLL_API dxfLayerData { 42 | public: 43 | dxfLayerData(const int colidx); 44 | ~dxfLayerData(); 45 | 46 | void setFillmode(const bool fillmode); 47 | 48 | void addLine(const dimeVec3f &v0, const dimeVec3f &v1, 49 | const dimeMatrix * const matrix = NULL); 50 | 51 | void addPoint(const dimeVec3f &v, 52 | const dimeMatrix * const matrix = NULL); 53 | 54 | void addTriangle(const dimeVec3f &v0, 55 | const dimeVec3f &v1, 56 | const dimeVec3f &v2, 57 | const dimeMatrix * const matrix = NULL); 58 | void addQuad(const dimeVec3f &v0, 59 | const dimeVec3f &v1, 60 | const dimeVec3f &v2, 61 | const dimeVec3f &v3, 62 | const dimeMatrix * const matrix = NULL); 63 | 64 | void writeWrl(FILE *fp, int indent, const bool vrml1, 65 | const bool only2d); 66 | 67 | //private: 68 | public: // 20011001 thammer - please don't kill me for this ;-) 69 | 70 | friend class dime2So; 71 | friend class dime2Profit; 72 | 73 | bool fillmode; 74 | int colidx; 75 | dimeBSPTree facebsp; 76 | dimeArray faceindices; 77 | dimeBSPTree linebsp; 78 | dimeArray lineindices; 79 | dimeArray points; 80 | }; 81 | 82 | #endif // _DXF2VRML_LAYERDATA_H_ 83 | -------------------------------------------------------------------------------- /include/dime/entities/3DFace.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_3DFACE_H 34 | #define DIME_3DFACE_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class DIME_DLL_API dime3DFace : public dimeFaceEntity 41 | { 42 | friend class dimeEntitiesSection; 43 | friend class dimeBlock; 44 | friend class dimeModel; 45 | friend class dimeEntity; 46 | friend class dimeSolid; 47 | friend class dimeTrace; 48 | 49 | public: 50 | dime3DFace(); 51 | 52 | virtual dimeEntity *copy(dimeModel * const model) const; 53 | 54 | virtual bool getRecord(const int groupcode, 55 | dimeParam ¶m, 56 | const int index = 0) const; 57 | virtual const char *getEntityName() const; 58 | 59 | enum Flags { 60 | EDGE1_INVISIBLE = 0x0001, 61 | EDGE2_INVISIBLE = 0x0002, 62 | EDGE3_INVISIBLE = 0x0004, 63 | EDGE4_INVISIBLE = 0x0008 64 | }; 65 | 66 | void setFlags(const int16 flags); 67 | int16 getFlags() const; 68 | 69 | virtual void print() const; 70 | virtual bool write(dimeOutput * const out); 71 | virtual int typeId() const; 72 | virtual int countRecords() const; 73 | 74 | protected: 75 | 76 | virtual bool handleRecord(const int groupcode, 77 | const dimeParam ¶m, 78 | dimeMemHandler * const memhandler); 79 | 80 | int16 flags; 81 | 82 | 83 | public: 84 | #ifndef NO_RR_DATA 85 | class dimeBlock *block; // ugly, needed for RR 86 | #endif 87 | }; // class dime3DFace 88 | 89 | #endif // ! DIME_3DFACE_H 90 | 91 | -------------------------------------------------------------------------------- /include/dime/entities/ExtrusionEntity.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_EXTRUSIONENTITY_H 34 | #define DIME_EXTRUSIONENTITY_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeExtrusionEntity : public dimeEntity 39 | { 40 | public: 41 | dimeExtrusionEntity(); 42 | 43 | virtual bool getRecord(const int groupcode, 44 | dimeParam ¶m, 45 | const int index = 0) const; 46 | 47 | void setExtrusionDir(const dimeVec3f &v); 48 | const dimeVec3f &getExtrusionDir() const; 49 | 50 | void setThickness(const dxfdouble val); 51 | dxfdouble getThickness() const; 52 | 53 | virtual int typeId() const; 54 | virtual bool isOfType(const int thtypeid) const; 55 | virtual int countRecords() const; 56 | 57 | protected: 58 | 59 | virtual bool handleRecord(const int groupcode, 60 | const dimeParam ¶m, 61 | dimeMemHandler * const memhandler); 62 | 63 | void copyExtrusionData(const dimeExtrusionEntity * const entity); 64 | bool writeExtrusionData(dimeOutput * const out); 65 | 66 | protected: // should be private :-( 67 | dimeVec3f extrusionDir; 68 | dxfdouble thickness; 69 | 70 | }; // class dimeExtrusionEntity 71 | 72 | inline void 73 | dimeExtrusionEntity::setExtrusionDir(const dimeVec3f &v) 74 | { 75 | this->extrusionDir = v; 76 | } 77 | 78 | inline const dimeVec3f & 79 | dimeExtrusionEntity::getExtrusionDir() const 80 | { 81 | return this->extrusionDir; 82 | } 83 | 84 | inline void 85 | dimeExtrusionEntity::setThickness(const dxfdouble val) 86 | { 87 | this->thickness = val; 88 | } 89 | 90 | inline dxfdouble 91 | dimeExtrusionEntity::getThickness() const 92 | { 93 | return this->thickness; 94 | } 95 | 96 | #endif // ! DIME_EXTRUSIONENTITY_H 97 | 98 | -------------------------------------------------------------------------------- /include/dime/entities/Line.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_LINE_H 34 | #define DIME_LINE_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class DIME_DLL_API dimeLine : public dimeExtrusionEntity 41 | { 42 | public: 43 | dimeLine(); 44 | 45 | const dimeVec3f &getCoords(const int idx) const; 46 | void setCoords(const int idx, const dimeVec3f &v); 47 | 48 | virtual dimeEntity *copy(dimeModel * const model) const; 49 | virtual bool getRecord(const int groupcode, 50 | dimeParam ¶m, 51 | const int index = 0) const; 52 | virtual const char *getEntityName() const; 53 | virtual void print() const; 54 | virtual bool write(dimeOutput * const out); 55 | virtual int typeId() const; 56 | virtual int countRecords() const; 57 | 58 | virtual GeometryType extractGeometry(dimeArray &verts, 59 | dimeArray &indices, 60 | dimeVec3f &extrusionDir, 61 | dxfdouble &thickness); 62 | 63 | protected: 64 | virtual bool handleRecord(const int groupcode, 65 | const dimeParam ¶m, 66 | dimeMemHandler * const memhandler); 67 | 68 | private: 69 | dimeVec3f coords[2]; 70 | 71 | }; // class dimeLine 72 | 73 | inline const dimeVec3f & 74 | dimeLine::getCoords(const int idx) const 75 | { 76 | assert(idx ==0 || idx == 1); 77 | return this->coords[idx]; 78 | } 79 | 80 | inline void 81 | dimeLine::setCoords(const int idx, const dimeVec3f &v) 82 | { 83 | assert(idx ==0 || idx == 1); 84 | this->coords[idx] = v; 85 | } 86 | 87 | #endif // ! DIME_LINE_H 88 | 89 | -------------------------------------------------------------------------------- /include/dime/entities/Point.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_POINT_H 34 | #define DIME_POINT_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class DIME_DLL_API dimePoint : public dimeExtrusionEntity 41 | { 42 | public: 43 | dimePoint(); 44 | 45 | const dimeVec3f &getCoords() const; 46 | void setCoords(const dimeVec3f &v); 47 | 48 | virtual dimeEntity *copy(dimeModel * const model) const; 49 | virtual bool getRecord(const int groupcode, 50 | dimeParam ¶m, 51 | const int index = 0) const; 52 | virtual const char *getEntityName() const; 53 | 54 | virtual bool write(dimeOutput * const out); 55 | virtual int typeId() const; 56 | virtual int countRecords() const; 57 | 58 | virtual GeometryType extractGeometry(dimeArray &verts, 59 | dimeArray &indices, 60 | dimeVec3f &extrusionDir, 61 | dxfdouble &thickness); 62 | 63 | protected: 64 | virtual bool handleRecord(const int groupcode, 65 | const dimeParam ¶m, 66 | dimeMemHandler * const memhandler); 67 | 68 | private: 69 | dimeVec3f coords; 70 | 71 | }; // class dimePoint 72 | 73 | inline const dimeVec3f & 74 | dimePoint::getCoords() const 75 | { 76 | return coords; 77 | } 78 | 79 | inline void 80 | dimePoint::setCoords(const dimeVec3f &v) 81 | { 82 | this->coords = v; 83 | } 84 | 85 | #endif // ! DIME_POINT_H 86 | 87 | -------------------------------------------------------------------------------- /include/dime/entities/Solid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_SOLID_H 34 | #define DIME_SOLID_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeSolid : public dimeFaceEntity 40 | { 41 | public: 42 | dimeSolid(); 43 | 44 | virtual dxfdouble getThickness() const; 45 | virtual void getExtrusionDir(dimeVec3f &ed) const; 46 | void setThickness(const dxfdouble &thickness); 47 | void setExtrusionDir(const dimeVec3f &ed); 48 | 49 | virtual bool write(dimeOutput * const out); 50 | virtual int typeId() const; 51 | virtual dimeEntity *copy(dimeModel * const model) const; 52 | virtual bool getRecord(const int groupcode, 53 | dimeParam ¶m, 54 | const int index = 0) const; 55 | virtual const char *getEntityName() const; 56 | virtual int countRecords() const; 57 | 58 | protected: 59 | virtual bool swapQuadCoords() const; 60 | 61 | virtual bool handleRecord(const int groupcode, 62 | const dimeParam ¶m, 63 | dimeMemHandler * const memhandler); 64 | 65 | 66 | private: 67 | dimeVec3f extrusionDir; 68 | dxfdouble thickness; 69 | 70 | }; // class dimeSolid 71 | 72 | #endif // ! DIME_SOLID_H 73 | 74 | -------------------------------------------------------------------------------- /include/dime/entities/Trace.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_TRACE_H 34 | #define DIME_TRACE_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeTrace : public dimeFaceEntity 40 | { 41 | public: 42 | dimeTrace(); 43 | 44 | virtual dxfdouble getThickness() const; 45 | virtual void getExtrusionDir(dimeVec3f &ed) const; 46 | void setThickness(const dxfdouble &thickness); 47 | void setExtrusionDir(const dimeVec3f &ed); 48 | 49 | virtual bool write(dimeOutput * const out); 50 | virtual int typeId() const; 51 | virtual dimeEntity *copy(dimeModel * const model) const; 52 | virtual bool getRecord(const int groupcode, 53 | dimeParam ¶m, 54 | const int index = 0) const; 55 | virtual const char *getEntityName() const; 56 | virtual int countRecords() const; 57 | 58 | protected: 59 | virtual bool swapQuadCoords() const; 60 | 61 | virtual bool handleRecord(const int groupcode, 62 | const dimeParam ¶m, 63 | dimeMemHandler * const memhandler); 64 | 65 | private: 66 | dimeVec3f extrusionDir; 67 | dxfdouble thickness; 68 | 69 | }; // class dimeTrace 70 | 71 | #endif // ! DIME_TRACE_H 72 | 73 | -------------------------------------------------------------------------------- /include/dime/entities/UnknownEntity.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UNKNOWNENTITY_H 34 | #define DIME_UNKNOWNENTITY_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeUnknownEntity : public dimeEntity 39 | { 40 | public: 41 | dimeUnknownEntity(const char * const name, dimeMemHandler * const memhandler); 42 | virtual ~dimeUnknownEntity(); 43 | 44 | virtual dimeEntity *copy(dimeModel * const model) const; 45 | 46 | virtual const char *getEntityName() const; 47 | virtual bool write(dimeOutput * const out); 48 | virtual int typeId() const; 49 | virtual int countRecords() const; 50 | 51 | private: 52 | char *entityName; 53 | 54 | }; // class dimeUnknownEntity 55 | 56 | #endif // ! DIME_UNKNOWNENTITY_H 57 | 58 | -------------------------------------------------------------------------------- /include/dime/objects/Object.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_OBJECT_H 34 | #define DIME_OBJECT_H 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | class dimeModel; 43 | 44 | class DIME_DLL_API dimeObject : public dimeRecordHolder 45 | { 46 | friend class dimeObjectesSection; 47 | friend class dimeModel; 48 | 49 | public: 50 | dimeObject(); 51 | virtual ~dimeObject(); 52 | 53 | virtual const char *getObjectName() const = 0; 54 | virtual dimeObject *copy(dimeModel * const model) const = 0; 55 | virtual bool read(dimeInput * const in); 56 | virtual bool write(dimeOutput * const out); 57 | virtual bool isOfType(const int thetypeid) const; 58 | virtual int typeId() const = 0; 59 | virtual int countRecords() const; 60 | virtual void print() const {} 61 | 62 | protected: 63 | virtual bool handleRecord(const int groupcode, 64 | const dimeParam ¶m, 65 | dimeMemHandler * const memhandler); 66 | 67 | public: 68 | static dimeObject *createObject(const char * const name, 69 | dimeMemHandler * const memhandler = NULL); 70 | protected: 71 | bool copyRecords(dimeObject * const newobject, dimeModel * const model) const; 72 | 73 | }; // class dimeObject 74 | 75 | #endif // ! DIME_OBJECT_H 76 | 77 | -------------------------------------------------------------------------------- /include/dime/objects/UnknownObject.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UNKNOWNOBJECT_H 34 | #define DIME_UNKNOWNOBJECT_H 35 | 36 | #include 37 | 38 | class dimeMemHandler; 39 | 40 | class DIME_DLL_API dimeUnknownObject : public dimeObject 41 | { 42 | public: 43 | dimeUnknownObject(const char * const name, dimeMemHandler * const memhandler); 44 | virtual ~dimeUnknownObject(); 45 | 46 | virtual dimeObject *copy(dimeModel * const model) const; 47 | 48 | virtual const char *getObjectName() const; 49 | virtual bool write(dimeOutput * const out); 50 | virtual int typeId() const; 51 | virtual int countRecords() const; 52 | 53 | private: 54 | char *objectName; 55 | 56 | }; // class dimeUnknownObject 57 | 58 | #endif // ! DIME_UNKNOWNOBJECT_H 59 | 60 | -------------------------------------------------------------------------------- /include/dime/records/DoubleRecord.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_DOUBLERECORD_H 34 | #define DIME_DOUBLERECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeDoubleRecord : public dimeRecord 39 | { 40 | public: 41 | dimeDoubleRecord(const int group_code = 10, const dxfdouble val = 0.0f); 42 | 43 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 44 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 45 | virtual void getValue(dimeParam ¶m) const; 46 | 47 | dxfdouble getValue() const; 48 | void setValue(const dxfdouble val); 49 | 50 | public: 51 | int typeId() const; 52 | bool read(dimeInput * const in); 53 | bool write(dimeOutput * const out); 54 | 55 | private: 56 | dxfdouble value; 57 | 58 | }; // class dimeDoubleRecord 59 | 60 | #endif // ! DIME_DOUBLERECORD_H 61 | 62 | -------------------------------------------------------------------------------- /include/dime/records/FloatRecord.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_FLOATRECORD_H 34 | #define DIME_FLOATRECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeFloatRecord : public dimeRecord 39 | { 40 | public: 41 | dimeFloatRecord(const int group_code = 10, const float val = 0.0f); 42 | 43 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 44 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 45 | virtual void getValue(dimeParam ¶m) const; 46 | 47 | float getValue() const; 48 | void setValue(const float val); 49 | 50 | public: 51 | int typeId() const; 52 | bool read(dimeInput * const in); 53 | bool write(dimeOutput * const out); 54 | 55 | private: 56 | float value; 57 | 58 | }; // class dimeFloatRecord 59 | 60 | #endif // ! DIME_FLOATRECORD_H 61 | 62 | -------------------------------------------------------------------------------- /include/dime/records/HexRecord.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_HEXRECORD_H 34 | #define DIME_HEXRECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeHexRecord : public dimeStringRecord 39 | { 40 | public: 41 | dimeHexRecord(const int group_code = 0); 42 | 43 | public: 44 | int typeId() const; 45 | 46 | }; // class dimeHexRecord 47 | 48 | #endif // ! DIME_HEXRECORD_H 49 | 50 | -------------------------------------------------------------------------------- /include/dime/records/Int16Record.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_INT16RECORD_H 34 | #define DIME_INT16RECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeInt16Record : public dimeRecord 39 | { 40 | public: 41 | dimeInt16Record(const int group_code = 60, const int16 val = 0); 42 | 43 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 44 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 45 | virtual void getValue(dimeParam ¶m) const; 46 | 47 | int16 getValue() const; 48 | void setValue(const int16 val); 49 | 50 | public: 51 | int typeId() const; 52 | bool read(dimeInput * const in); 53 | bool write(dimeOutput * const out); 54 | 55 | private: 56 | int16 value; 57 | 58 | }; // class dimeInt16Record 59 | 60 | #endif // ! DIME_INT16RECORD_H 61 | 62 | -------------------------------------------------------------------------------- /include/dime/records/Int32Record.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_INT32RECORD_H 34 | #define DIME_INT32RECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeInt32Record : public dimeRecord 39 | { 40 | public: 41 | dimeInt32Record(const int group_code = 90, const int32 val = 0); 42 | 43 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 44 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 45 | virtual void getValue(dimeParam ¶m) const; 46 | 47 | int32 getValue() const; 48 | void setValue(const int32 val); 49 | 50 | public: 51 | int typeId() const; 52 | bool read(dimeInput * const in); 53 | bool write(dimeOutput * const out); 54 | 55 | private: 56 | int32 value; 57 | 58 | }; // class dimeInt32Record 59 | 60 | #endif // ! DIME_INT32RECORD_H 61 | 62 | -------------------------------------------------------------------------------- /include/dime/records/Int8Record.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_INT8RECORD_H 34 | #define DIME_INT8RECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeInt8Record : public dimeRecord 39 | { 40 | public: 41 | dimeInt8Record(const int group_code = 270, const int8 val = 0); 42 | 43 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 44 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 45 | virtual void getValue(dimeParam ¶m) const; 46 | 47 | int8 getValue() const; 48 | void setValue(const int8 val); 49 | 50 | public: 51 | int typeId() const; 52 | bool read(dimeInput * const in); 53 | bool write(dimeOutput * const out); 54 | 55 | private: 56 | int8 value; 57 | 58 | }; // class dimeInt8Record 59 | 60 | #endif // ! DIME_INT8RECORD_H 61 | 62 | -------------------------------------------------------------------------------- /include/dime/records/Record.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_RECORD_H 34 | #define DIME_RECORD_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class dimeInput; 41 | class dimeOutput; 42 | 43 | class DIME_DLL_API dimeRecord : public dimeBase 44 | { 45 | public: 46 | dimeRecord(const int group_code); 47 | virtual ~dimeRecord(); 48 | 49 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL) = 0; 50 | virtual void getValue(dimeParam ¶m) const = 0; 51 | virtual dimeRecord *copy(dimeMemHandler * const memhandler) const = 0; 52 | 53 | void setGroupCode(const int group_code); 54 | int getGroupCode() const; 55 | 56 | 57 | public: 58 | virtual bool isEndOfSectionRecord() const; 59 | virtual bool isEndOfFileRecord() const; 60 | virtual int typeId() const = 0; 61 | virtual bool read(dimeInput * const in) = 0; 62 | virtual bool write(dimeOutput * const out); 63 | virtual void print() const {fprintf(stderr, "rec: %d\n", groupCode);} 64 | 65 | public: 66 | static bool readRecordData(dimeInput * const in, const int group_code, 67 | dimeParam ¶m); 68 | static dimeRecord *readRecord(dimeInput * const in); 69 | static dimeRecord *createRecord(const int group_code, 70 | dimeMemHandler * const memhandler); 71 | static dimeRecord *createRecord(const int group_code, 72 | const dimeParam ¶m, 73 | dimeMemHandler * const memhandler); 74 | static int getRecordType(const int group_code); 75 | 76 | protected: 77 | int groupCode; 78 | 79 | }; // class dimeRecord 80 | 81 | #endif // ! DIME_RECORD_H 82 | 83 | -------------------------------------------------------------------------------- /include/dime/records/StringRecord.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_STRINGRECORD_H 34 | #define DIME_STRINGRECORD_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeStringRecord : public dimeRecord 39 | { 40 | public: 41 | dimeStringRecord(const int group_code = 0); 42 | virtual ~dimeStringRecord(); 43 | 44 | virtual dimeRecord *copy(dimeMemHandler * const mh) const; 45 | virtual void setValue(const dimeParam ¶m, dimeMemHandler * const memhandler = NULL); 46 | virtual void getValue(dimeParam ¶m) const; 47 | 48 | void setStringPointer(char * const s); 49 | bool setString(const char * const s, 50 | dimeMemHandler * const memhandler = NULL); 51 | char *getString(); 52 | 53 | public: 54 | bool isEndOfSectionRecord() const; 55 | bool isEndOfFileRecord() const; 56 | int typeId() const; 57 | bool read(dimeInput * const in); 58 | bool write(dimeOutput * const out); 59 | 60 | protected: 61 | char *string; 62 | 63 | }; // class dimeStringRecord 64 | 65 | #endif // ! DIME_STRINGRECORD_H 66 | 67 | -------------------------------------------------------------------------------- /include/dime/sections/BlocksSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_BLOCKSSECTION_H 34 | #define DIME_BLOCKSSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeBlocksSection : public dimeSection 40 | { 41 | public: 42 | dimeBlocksSection(dimeMemHandler * const memhandler = NULL); 43 | virtual ~dimeBlocksSection(); 44 | 45 | virtual const char *getSectionName() const; 46 | virtual dimeSection *copy(dimeModel * const model) const; 47 | 48 | public: 49 | virtual bool read(dimeInput * const file); 50 | virtual bool write(dimeOutput * const file); 51 | virtual int typeId() const; 52 | virtual int countRecords() const; 53 | 54 | void fixReferences(dimeModel * const model); 55 | 56 | int getNumBlocks() const; 57 | class dimeBlock *getBlock(const int idx); 58 | void removeBlock(const int idx); 59 | void insertBlock(dimeBlock * const block, const int idx = -1); 60 | 61 | private: 62 | dimeArray blocks; 63 | 64 | }; // class dimeBlocksSection 65 | 66 | #endif // ! DIME_BLOCKSSECTION_H 67 | 68 | -------------------------------------------------------------------------------- /include/dime/sections/ClassesSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_CLASSESSECTION_H 34 | #define DIME_CLASSESSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeClassesSection : public dimeSection 40 | { 41 | friend class dimeModel; 42 | 43 | public: 44 | dimeClassesSection(dimeMemHandler * const memhandler = NULL); 45 | virtual ~dimeClassesSection(); 46 | 47 | virtual const char *getSectionName() const; 48 | virtual dimeSection *copy(dimeModel * const model) const; 49 | 50 | virtual bool read(dimeInput * const file); 51 | virtual bool write(dimeOutput * const file); 52 | virtual int typeId() const; 53 | virtual int countRecords() const; 54 | 55 | int getNumClasses() const; 56 | class dimeClass *getClass(const int idx); 57 | void removeClass(const int idx); 58 | void insertClass(dimeClass * const myclass, const int idx = -1); 59 | 60 | private: 61 | dimeArray classes; 62 | 63 | }; // class dimeClassesSection 64 | 65 | #endif // ! DIME_CLASSESSECTION_H 66 | 67 | -------------------------------------------------------------------------------- /include/dime/sections/EntitiesSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_ENTITIESSECTION_H 34 | #define DIME_ENTITIESSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeEntitiesSection : public dimeSection 40 | { 41 | friend class dimeModel; 42 | 43 | public: 44 | dimeEntitiesSection(dimeMemHandler * const memhandler = NULL); 45 | virtual ~dimeEntitiesSection(); 46 | 47 | virtual const char *getSectionName() const; 48 | virtual dimeSection *copy(dimeModel * const model) const; 49 | 50 | virtual bool read(dimeInput * const file); 51 | virtual bool write(dimeOutput * const file); 52 | virtual int typeId() const; 53 | virtual int countRecords() const; 54 | 55 | void fixReferences(dimeModel * const model); 56 | 57 | int getNumEntities() const; 58 | dimeEntity *getEntity(const int idx); 59 | void removeEntity(const int idx); 60 | void insertEntity(dimeEntity * const entity, const int idx = -1); 61 | 62 | private: 63 | dimeArray entities; 64 | 65 | }; // class dimeEntitiesSection 66 | 67 | #endif // ! DIME_ENTITIESSECTION_H 68 | 69 | -------------------------------------------------------------------------------- /include/dime/sections/HeaderSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_HEADERSECTION_H 34 | #define DIME_HEADERSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeHeaderSection : public dimeSection 40 | { 41 | public: 42 | dimeHeaderSection(dimeMemHandler * const memhandler); 43 | virtual ~dimeHeaderSection(); 44 | 45 | int getVariable(const char * const variableName, 46 | int * const groupcodes, 47 | dimeParam * const params, 48 | const int maxparams) const; 49 | 50 | int setVariable(const char * const variableName, 51 | const int * const groupcodes, 52 | const dimeParam * const params, 53 | const int numparams, 54 | dimeMemHandler * const memhandler = NULL); 55 | 56 | virtual const char *getSectionName() const; 57 | virtual dimeSection *copy(dimeModel * const model) const; 58 | 59 | virtual bool read(dimeInput * const file); 60 | virtual bool write(dimeOutput * const file); 61 | virtual int typeId() const; 62 | virtual int countRecords() const; 63 | 64 | private: 65 | int findVariable(const char * const name) const; 66 | 67 | dimeArray records; 68 | 69 | }; // class dimeHeaderSection 70 | 71 | #endif // ! DIME_HEADERSECTION_H 72 | 73 | -------------------------------------------------------------------------------- /include/dime/sections/ObjectsSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_OBJECTSSECTION_H 34 | #define DIME_OBJECTSSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeObjectsSection : public dimeSection 40 | { 41 | friend class dimeModel; 42 | 43 | public: 44 | dimeObjectsSection(dimeMemHandler * const memhandler = NULL); 45 | virtual ~dimeObjectsSection(); 46 | 47 | virtual const char *getSectionName() const; 48 | virtual dimeSection *copy(dimeModel * const model) const; 49 | 50 | virtual bool read(dimeInput * const file); 51 | virtual bool write(dimeOutput * const file); 52 | virtual int typeId() const; 53 | virtual int countRecords() const; 54 | 55 | int getNumObjects() const; 56 | class dimeObject *getObject(const int idx); 57 | void removeObject(const int idx); 58 | void insertObject(dimeObject * const object, const int idx = -1); 59 | 60 | private: 61 | dimeArray objects; 62 | 63 | }; // class dimeObjectsSection 64 | 65 | #endif // ! DIME_OBJECTSSECTION_H 66 | 67 | -------------------------------------------------------------------------------- /include/dime/sections/Section.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_SECTION_H 34 | #define DIME_SECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class dimeInput; 40 | class dimeModel; 41 | class dimeOutput; 42 | 43 | class DIME_DLL_API dimeSection : public dimeBase 44 | { 45 | public: 46 | dimeSection(dimeMemHandler * const memhandler); 47 | virtual ~dimeSection(); 48 | 49 | virtual const char *getSectionName() const = 0; 50 | virtual dimeSection *copy(dimeModel * const model) const = 0; 51 | 52 | virtual bool read(dimeInput * const file) = 0; 53 | virtual bool write(dimeOutput * const file) = 0; 54 | virtual int typeId() const = 0; 55 | virtual bool isOfType(const int thetypeid) const; 56 | virtual int countRecords() const = 0; 57 | 58 | public: 59 | static dimeSection *createSection(const char * const sectionname, 60 | dimeMemHandler *memhandler); 61 | 62 | protected: 63 | dimeMemHandler *memHandler; 64 | 65 | }; // class dimeSection 66 | 67 | #endif // ! DIME_SECTION_H 68 | 69 | -------------------------------------------------------------------------------- /include/dime/sections/TablesSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_TABLESSECTION_H 34 | #define DIME_TABLESSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeTablesSection : public dimeSection 40 | { 41 | public: 42 | dimeTablesSection(dimeMemHandler * const memhandler = NULL); 43 | virtual ~dimeTablesSection(); 44 | 45 | virtual const char *getSectionName() const; 46 | virtual dimeSection *copy(dimeModel * const model) const; 47 | 48 | public: 49 | virtual bool read(dimeInput * const file); 50 | virtual bool write(dimeOutput * const file); 51 | virtual int typeId() const; 52 | virtual int countRecords() const; 53 | 54 | int getNumTables() const; 55 | class dimeTable *getTable(const int idx); 56 | void removeTable(const int idx); 57 | void insertTable(dimeTable * const table, const int idx = -1); 58 | 59 | private: 60 | dimeArray tables; 61 | 62 | }; // class dimeTablesSection 63 | 64 | #endif // ! DIME_TABLESSECTION_H 65 | 66 | -------------------------------------------------------------------------------- /include/dime/sections/UnknownSection.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UNKNOWNSECTION_H 34 | #define DIME_UNKNOWNSECTION_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeUnknownSection : public dimeSection 40 | { 41 | friend class dimeModel; 42 | 43 | public: 44 | dimeUnknownSection(const char * const sectionname, 45 | dimeMemHandler *memhandler = NULL); 46 | virtual ~dimeUnknownSection(); 47 | 48 | virtual const char *getSectionName() const; 49 | virtual dimeSection *copy(dimeModel * const model) const; 50 | 51 | public: 52 | virtual bool read(dimeInput * const file); 53 | virtual bool write(dimeOutput * const file); 54 | virtual int typeId() const; 55 | virtual int countRecords() const; 56 | 57 | private: 58 | char *sectionName; 59 | class dimeRecord **records; 60 | int numRecords; 61 | 62 | }; // class dimeUnknownSection 63 | 64 | #endif // ! DIME_UNKNOWNSECTION_H 65 | 66 | -------------------------------------------------------------------------------- /include/dime/tables/LayerTable.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_LAYERTABLE_H 34 | #define DIME_LAYERTABLE_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeLayerTable : public dimeTableEntry 39 | { 40 | public: 41 | dimeLayerTable(); 42 | virtual ~dimeLayerTable(); 43 | 44 | void setLayerName(const char * name, dimeMemHandler * const memhandler); 45 | const char * getLayerName(void) const; 46 | 47 | void setColorNumber(const int16 colnum); 48 | int16 getColorNumber(void) const; 49 | 50 | void registerLayer(dimeModel * model); 51 | 52 | virtual dimeTableEntry *copy(dimeModel * const model) const; 53 | 54 | virtual const char *getTableName() const; 55 | virtual bool read(dimeInput * const in); 56 | virtual bool write(dimeOutput * const out); 57 | virtual int typeId() const; 58 | virtual int countRecords() const; 59 | 60 | protected: 61 | 62 | virtual bool handleRecord(const int groupcode, 63 | const dimeParam ¶m, 64 | dimeMemHandler * const memhandler); 65 | 66 | private: 67 | int16 colorNumber; 68 | char * layerName; 69 | class dimeLayer * layerInfo; 70 | 71 | }; // class dimeLayerTable 72 | 73 | #endif // ! DIME_LAYERTABLE_H 74 | 75 | -------------------------------------------------------------------------------- /include/dime/tables/Table.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_TABLE_H 34 | #define DIME_TABLE_H 35 | 36 | #include 37 | #include 38 | 39 | class dimeInput; 40 | class dimeModel; 41 | class dimeOutput; 42 | class dimeTableEntry; 43 | class dimeRecord; 44 | 45 | class DIME_DLL_API dimeTable : public dimeBase 46 | { 47 | public: 48 | dimeTable(dimeMemHandler * const memhandler); 49 | virtual ~dimeTable(); 50 | 51 | bool read(dimeInput * const in); 52 | bool write(dimeOutput * const out); 53 | dimeTable *copy(dimeModel * const model) const; 54 | int typeId() const; 55 | int countRecords() const; 56 | int tableType() const; 57 | 58 | void setTableName(const char * name); 59 | const char * tableName() const; 60 | 61 | int getNumTableEntries() const; 62 | dimeTableEntry *getTableEntry(const int idx); 63 | void insertTableEntry(dimeTableEntry * const tableEntry, const int idx = -1); 64 | void removeTableEntry(const int idx); 65 | 66 | int getNumTableRecords() const; 67 | dimeRecord *getTableRecord(const int idx); 68 | void insertTableRecord(dimeRecord * const record, const int idx = -1); 69 | void removeTableRecord(const int idx); 70 | 71 | private: 72 | int16 maxEntries; // dummy variable read from file 73 | char * tablename; 74 | dimeArray tableEntries; 75 | dimeArray records; 76 | dimeMemHandler *memHandler; 77 | }; // class dimeTable 78 | 79 | #endif // ! DIME_TABLE_H 80 | 81 | -------------------------------------------------------------------------------- /include/dime/tables/TableEntry.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_TABLEENTRY_H 34 | #define DIME_TABLEENTRY_H 35 | 36 | #include 37 | #include 38 | 39 | class dimeModel; 40 | 41 | class DIME_DLL_API dimeTableEntry : public dimeRecordHolder 42 | { 43 | friend class dimeUnknownTable; 44 | friend class dimeLayerTable; 45 | 46 | public: 47 | dimeTableEntry(); 48 | virtual ~dimeTableEntry(); 49 | 50 | virtual const char *getTableName() const = 0; 51 | virtual bool read(dimeInput * const in); 52 | virtual bool write(dimeOutput * const out); 53 | virtual dimeTableEntry *copy(dimeModel * const model) const = 0; 54 | virtual int typeId() const = 0; 55 | virtual bool isOfType(const int thetypeid) const; 56 | virtual int countRecords() const; 57 | 58 | static dimeTableEntry *createTableEntry(const char * const name, 59 | dimeMemHandler * const memhandler = NULL); 60 | 61 | protected: 62 | bool preWrite(dimeOutput * const output); 63 | 64 | virtual bool handleRecord(const int groupcode, 65 | const dimeParam ¶m, 66 | dimeMemHandler * const memhandler); 67 | 68 | bool copyRecords(dimeTableEntry * const table, dimeModel * const model) const; 69 | 70 | }; // class dimeTableEntry 71 | 72 | #endif // ! DIME_TABLEENTRY_H 73 | 74 | -------------------------------------------------------------------------------- /include/dime/tables/UCSTable.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UCSTABLE_H 34 | #define DIME_UCSTABLE_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeUCSTable : public dimeTableEntry 40 | { 41 | public: 42 | dimeUCSTable(); 43 | 44 | virtual dimeTableEntry *copy(dimeModel * const model) const; 45 | virtual const char *getTableName() const; 46 | 47 | const dimeVec3f &getOrigin() const; 48 | const dimeVec3f &getXaxis() const; 49 | const dimeVec3f &getYaxis() const; 50 | 51 | void setOrigin(const dimeVec3f &v); 52 | void setXaxis(const dimeVec3f &v); 53 | void setYaxis(const dimeVec3f &v); 54 | 55 | virtual bool write(dimeOutput * const out); 56 | virtual int typeId() const; 57 | virtual int countRecords() const; 58 | 59 | protected: 60 | virtual bool handleRecord(const int groupcodes, 61 | const dimeParam ¶m, 62 | dimeMemHandler * const memhandler); 63 | 64 | private: 65 | dimeVec3f origin; 66 | dimeVec3f xaxis; 67 | dimeVec3f yaxis; 68 | 69 | }; // class dimeUCSTable 70 | 71 | inline const dimeVec3f & 72 | dimeUCSTable::getOrigin() const 73 | { 74 | return this->origin; 75 | } 76 | 77 | inline const dimeVec3f & 78 | dimeUCSTable::getXaxis() const 79 | { 80 | return this->xaxis; 81 | } 82 | 83 | inline const dimeVec3f & 84 | dimeUCSTable::getYaxis() const 85 | { 86 | return this->yaxis; 87 | } 88 | 89 | inline void 90 | dimeUCSTable::setOrigin(const dimeVec3f &v) 91 | { 92 | this->origin = v; 93 | } 94 | 95 | inline void 96 | dimeUCSTable::setXaxis(const dimeVec3f &v) 97 | { 98 | this->origin = v; 99 | } 100 | 101 | inline void 102 | dimeUCSTable::setYaxis(const dimeVec3f &v) 103 | { 104 | this->origin = v; 105 | } 106 | 107 | #endif // ! DIME_UCSTABLE_H 108 | 109 | -------------------------------------------------------------------------------- /include/dime/tables/UnknownTable.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_UNKNOWNTABLE_H 34 | #define DIME_UNKNOWNTABLE_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeUnknownTable : public dimeTableEntry 39 | { 40 | public: 41 | dimeUnknownTable(const char * const name, dimeMemHandler * const memhandler); 42 | virtual ~dimeUnknownTable(); 43 | 44 | virtual const char *getTableName() const; 45 | virtual dimeTableEntry *copy(dimeModel * const model) const; 46 | virtual bool write(dimeOutput * const out); 47 | virtual int typeId() const; 48 | virtual int countRecords() const; 49 | 50 | private: 51 | char *tableName; 52 | 53 | }; // class dimeUnknownTable 54 | 55 | #endif // ! DIME_UNKNOWNTABLE_H 56 | 57 | -------------------------------------------------------------------------------- /include/dime/util/BSPTree.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_BSPTREE_H 34 | #define DIME_BSPTREE_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | class dimeBox; 41 | class dime_bspnode; 42 | 43 | class DIME_DLL_API dimeBSPTree 44 | { 45 | public: 46 | dimeBSPTree(const int maxnodepts = 64, const int initsize = 4); 47 | ~dimeBSPTree(); 48 | 49 | int numPoints() const; 50 | void getPoint(const int idx, dimeVec3f &pt); 51 | void *getUserData(const int idx) const; 52 | 53 | void setUserData(const int idx, void * const data); 54 | 55 | int addPoint(const dimeVec3f &pt, void * const userdata = NULL); 56 | int removePoint(const dimeVec3f &pt); 57 | void removePoint(const int idx); 58 | int findPoint(const dimeVec3f &pos) const; 59 | void clear(const int initsize = 4); 60 | 61 | const dimeBox *getBBox() const; 62 | 63 | private: 64 | friend class dime_bspnode; 65 | dimeArray pointsArray; 66 | dimeArray userdataArray; 67 | dime_bspnode *topnode; 68 | int maxnodepoints; 69 | dimeBox *boundingBox; 70 | }; // class dimeBSPTree 71 | 72 | #endif // ! DIME_BSPTREE_H 73 | 74 | -------------------------------------------------------------------------------- /include/dime/util/Box.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_BOX_H 34 | #define DIME_BOX_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeBox 40 | { 41 | public: 42 | dimeVec3f min, max; 43 | public: 44 | dimeBox(); 45 | dimeBox(const dxfdouble x0, const dxfdouble y0, const dxfdouble z0, 46 | const dxfdouble x1, const dxfdouble y1, const dxfdouble z1); 47 | 48 | void set(const dxfdouble x0, const dxfdouble y0, const dxfdouble z0, 49 | const dxfdouble x1, const dxfdouble y1, const dxfdouble z1); 50 | 51 | void get(dxfdouble &x0, dxfdouble &y0, dxfdouble &z0, 52 | dxfdouble &x1, dxfdouble &y1, dxfdouble &z1) const; 53 | 54 | bool operator & (const dimeBox &box) const; 55 | 56 | bool pointInside(const dimeVec3f &pt) const; 57 | 58 | dimeVec3f center() const; 59 | 60 | void makeEmpty(); 61 | void grow(const dimeVec3f &pt); 62 | dxfdouble size() const; 63 | bool hasExtent() const; 64 | }; // class dimeBox 65 | 66 | inline bool 67 | dimeBox::pointInside(const dimeVec3f &pt) const 68 | { 69 | return ! (pt[0] < this->min[0] || pt[0] >= this->max[0] || 70 | pt[1] < this->min[1] || pt[1] >= this->max[1] || 71 | pt[2] < this->min[2] || pt[2] >= this->max[2]); 72 | } 73 | 74 | inline dimeVec3f 75 | dimeBox::center() const 76 | { 77 | return dimeVec3f((min[0]+max[0])*0.5f, 78 | (min[1]+max[1])*0.5f, 79 | (min[2]+max[2])*0.5f); 80 | } 81 | 82 | #endif // ! DIME_BOX_H 83 | 84 | -------------------------------------------------------------------------------- /include/dime/util/Dict.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_DICT_H 34 | #define DIME_DICT_H 35 | 36 | #include 37 | #include 38 | 39 | class DIME_DLL_API dimeDictEntry 40 | { 41 | friend class dimeDict; 42 | 43 | private: 44 | dimeDictEntry *next; 45 | dimeDictEntry(const char * const k, void *v) {key = strdup(k); value = v; }; 46 | ~dimeDictEntry() {free(key);} 47 | char *key; 48 | void *value; 49 | 50 | }; // class dimeDictEntry 51 | 52 | class DIME_DLL_API dimeDict 53 | { 54 | public: 55 | dimeDict(const int entries = 17989); 56 | ~dimeDict(); 57 | void clear(); 58 | 59 | bool enter(const char * const key, char *&ptr, void *value); 60 | const char *enter(const char * const key, void *value); 61 | const char *find(const char * const key) const; 62 | bool find(const char * const key, void *&value) const; 63 | bool remove(const char * const key); 64 | void dump(void); 65 | 66 | private: 67 | int tableSize; 68 | dimeDictEntry **buckets; 69 | dimeDictEntry *&findEntry(const char * const key) const; 70 | unsigned int bucketNr(const char *key) const; 71 | 72 | public: 73 | void print_info(); 74 | 75 | }; // class dimeDict 76 | 77 | #endif // ! DIME_DICT_H 78 | 79 | -------------------------------------------------------------------------------- /include/dime/util/MemHandler.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef DIME_MEMHANDLER_H 34 | #define DIME_MEMHANDLER_H 35 | 36 | #include 37 | 38 | class DIME_DLL_API dimeMemHandler 39 | { 40 | public: 41 | dimeMemHandler(); 42 | ~dimeMemHandler(); 43 | 44 | bool initOk() const; 45 | 46 | char *stringAlloc(const char * const string); 47 | void *allocMem(const int size, const int alignment = 4); 48 | 49 | private: 50 | 51 | class dimeMemNode *bigmemnode; // linked list of big memory chunks 52 | class dimeMemNode *memnode; // linked list of memory nodes. 53 | 54 | }; // class dimeMemHandler 55 | 56 | #endif // ! DIME_MEMHANDLER_H 57 | 58 | -------------------------------------------------------------------------------- /src/State.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeState dime/State.h 35 | \brief The dimeState class manages various state variables while the 36 | model is traversed. 37 | */ 38 | 39 | #include 40 | 41 | /*! 42 | Constructor. 43 | */ 44 | 45 | dimeState::dimeState(const bool traversePolylineVertices, 46 | const bool explodeInserts) 47 | { 48 | this->matrix.makeIdentity(); 49 | this->invmatrix.makeIdentity(); 50 | this->currentInsert = NULL; 51 | this->flags = 0; 52 | if (traversePolylineVertices) { 53 | this->flags |= TRAVERSE_POLYLINE_VERTICES; 54 | } 55 | if (explodeInserts) { 56 | this->flags |= EXPLODE_INSERTS; 57 | } 58 | } 59 | 60 | /*! 61 | Constructor. 62 | */ 63 | 64 | dimeState::dimeState(const dimeState &st) 65 | { 66 | this->matrix = st.matrix; 67 | this->invmatrix = st.invmatrix; 68 | this->flags = st.flags; 69 | this->currentInsert = st.currentInsert; 70 | } 71 | 72 | void 73 | dimeState::setMatrix(const dimeMatrix &m) 74 | { 75 | this->matrix = m; 76 | this->flags |= INVMATRIX_DIRTY; 77 | } 78 | 79 | 80 | const dimeMatrix & 81 | dimeState::getInvMatrix() const 82 | { 83 | if (this->flags & INVMATRIX_DIRTY) { 84 | dimeState *thisp = (dimeState*)this; 85 | thisp->invmatrix = thisp->matrix; 86 | thisp->invmatrix.inverse(); 87 | thisp->flags ^= INVMATRIX_DIRTY; 88 | } 89 | return this->invmatrix; 90 | } 91 | 92 | void 93 | dimeState::getMatrix(dimeMatrix &m) const 94 | { 95 | m = this->matrix; 96 | } 97 | 98 | -------------------------------------------------------------------------------- /src/classes/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | INCLUDES = -I$(top_srcdir)/include 4 | LIBS = 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = classes.lst 8 | else 9 | noinst_LTLIBRARIES = libclasses.la 10 | endif 11 | 12 | ClassesSources = \ 13 | Class.cpp Class.h \ 14 | UnknownClass.cpp UnknownClass.h 15 | 16 | libclasses_la_SOURCES = \ 17 | $(ClassesSources) 18 | 19 | classes_lst_SOURCES = \ 20 | $(ClassesSources) 21 | 22 | classes.lst: Makefile $(classes_lst_OBJECTS) 23 | @echo "Linking classes.lst..."; \ 24 | rm -f $@; \ 25 | for i in $(classes_lst_OBJECTS); do echo $$i >>$@; done 26 | 27 | classesincdir = $(includedir)/dime/classes 28 | classesinc_HEADERS = \ 29 | ../../include/dime/classes/Class.h \ 30 | ../../include/dime/classes/UnknownClass.h 31 | 32 | install-classesincHEADERS: $(classesinc_HEADERS) 33 | @$(NORMAL_INSTALL) 34 | $(mkinstalldirs) $(DESTDIR)$(classesincdir) 35 | @list='$(classesinc_HEADERS)'; for p in $$list; do \ 36 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 37 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 38 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(classesincdir)/$$f"; \ 39 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(classesincdir)/$$f; \ 40 | done 41 | 42 | uninstall-classesincHEADERS: 43 | @$(NORMAL_UNINSTALL) 44 | @list='$(classesinc_HEADERS)'; for p in $$list; do \ 45 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 46 | echo " rm -f $(DESTDIR)$(classesincdir)/$$f"; \ 47 | rm -f $(DESTDIR)$(classesincdir)/$$f; \ 48 | done 49 | 50 | -------------------------------------------------------------------------------- /src/convert/3dfaceconvert.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "convert_funcs.h" 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | void 40 | convert_3dface(const dimeEntity *entity, const dimeState *state, 41 | dxfLayerData *layerData, dxfConverter *) 42 | { 43 | dimeMatrix matrix; 44 | state->getMatrix(matrix); 45 | dime3DFace *face = (dime3DFace*)entity; 46 | 47 | dimeVec3f v0, v1, v2, v3; 48 | face->getVertices(v0, v1, v2, v3); 49 | 50 | if (v2 == v3) { 51 | layerData->addTriangle(v0, v1, v2, &matrix); 52 | } 53 | else { 54 | layerData->addQuad(v0, v1, v2, v3, &matrix); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/convert/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | INCLUDES = -I$(top_srcdir)/include 4 | LIBS = 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = convert.lst 8 | else 9 | noinst_LTLIBRARIES = libconvert.la 10 | endif 11 | 12 | ## All source files used when building this submodule, including all 13 | ## headers. 14 | 15 | ConvertSources = \ 16 | 3dfaceconvert.cpp \ 17 | arcconvert.cpp \ 18 | circleconvert.cpp \ 19 | convert.cpp \ 20 | convert_funcs.h \ 21 | ellipseconvert.cpp \ 22 | layerdata.cpp \ 23 | lineconvert.cpp \ 24 | linesegment.cpp \ 25 | linesegment.h \ 26 | lwpolylineconvert.cpp \ 27 | pointconvert.cpp \ 28 | polylineconvert.cpp \ 29 | solidconvert.cpp \ 30 | traceconvert.cpp 31 | 32 | libconvert_la_SOURCES = \ 33 | $(ConvertSources) 34 | 35 | convert_lst_SOURCES = \ 36 | $(ConvertSources) 37 | 38 | convert.lst: Makefile $(convert_lst_OBJECTS) 39 | @echo "Linking convert.lst..."; \ 40 | rm -f $@; \ 41 | for i in $(convert_lst_OBJECTS); do echo $$i >>$@; done 42 | 43 | ## Installation information. 44 | 45 | libconvertincdir = $(includedir)/dime/convert 46 | libconvertinc_HEADERS = \ 47 | $(top_srcdir)/include/dime/convert/convert.h \ 48 | $(top_srcdir)/include/dime/convert/layerdata.h 49 | 50 | install-libconvertincHEADERS: $(libconvertinc_HEADERS) 51 | @$(NORMAL_INSTALL) 52 | $(mkinstalldirs) $(DESTDIR)$(libconvertincdir) 53 | @list='$(libconvertinc_HEADERS)'; for p in $$list; do \ 54 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 55 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 56 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libconvertincdir)/$$f"; \ 57 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libconvertincdir)/$$f; \ 58 | done 59 | 60 | uninstall-libconvertincHEADERS: 61 | @$(NORMAL_UNINSTALL) 62 | @list='$(libconvertinc_HEADERS)'; for p in $$list; do \ 63 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 64 | echo " rm -f $(DESTDIR)$(libconvertincdir)/$$f"; \ 65 | rm -f $(DESTDIR)$(libconvertincdir)/$$f; \ 66 | done 67 | 68 | -------------------------------------------------------------------------------- /src/convert/convert_funcs.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef _DXF2VRML_CONVERT_FUNCS_H_ 34 | #define _DXF2VRML_CONVERT_FUNCS_H_ 35 | 36 | class dimeEntity; 37 | class dimeState; 38 | class dxfLayerData; 39 | class dxfConverter; 40 | 41 | #ifndef M_PI 42 | #define M_PI 3.14159265358979323846 43 | #endif // M_PI 44 | 45 | void convert_3dface(const dimeEntity *, const dimeState *, 46 | dxfLayerData *, dxfConverter *); 47 | void convert_line(const dimeEntity *, const dimeState *, 48 | dxfLayerData *, dxfConverter *); 49 | void convert_point(const dimeEntity *, const dimeState *, 50 | dxfLayerData *, dxfConverter *); 51 | void convert_circle(const dimeEntity *, const dimeState *, 52 | dxfLayerData *, dxfConverter *); 53 | void convert_ellipse(const dimeEntity *, const dimeState *, 54 | dxfLayerData *, dxfConverter *); 55 | void convert_arc(const dimeEntity *, const dimeState *, 56 | dxfLayerData *, dxfConverter *); 57 | void convert_solid(const dimeEntity *, const dimeState *, 58 | dxfLayerData *, dxfConverter *); 59 | void convert_trace(const dimeEntity *, const dimeState *, 60 | dxfLayerData *, dxfConverter *); 61 | void convert_polyline(const dimeEntity *, const dimeState *, 62 | dxfLayerData *, dxfConverter *); 63 | void convert_lwpolyline(const dimeEntity *, const dimeState *, 64 | dxfLayerData *, dxfConverter *); 65 | 66 | #endif // _DXF2VRML_CONVERT_FUNCS_H_ 67 | -------------------------------------------------------------------------------- /src/convert/lineconvert.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "convert_funcs.h" 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | void 40 | convert_line(const dimeEntity *entity, const dimeState *state, 41 | dxfLayerData *layerData, dxfConverter *) 42 | { 43 | dimeLine *line = (dimeLine*)entity; 44 | 45 | dxfdouble thickness; 46 | dimeVec3f v0, v1; 47 | 48 | dimeMatrix matrix; 49 | state->getMatrix(matrix); 50 | 51 | v0 = line->getCoords(0); 52 | v1 = line->getCoords(1); 53 | 54 | dimeParam param; 55 | if (line->getRecord(38, param)) { 56 | v0[2] = param.double_data; 57 | v1[2] = param.double_data; 58 | } 59 | 60 | thickness = line->getThickness(); 61 | 62 | if (thickness != 0.0) { 63 | dimeVec3f v2, v3; 64 | dimeVec3f e = line->getExtrusionDir(); 65 | v2 = v0 + e * thickness; 66 | v3 = v1 + e * thickness; 67 | 68 | layerData->addQuad(v0, v1, v3, v2, &matrix); 69 | } 70 | else { 71 | layerData->addLine(v0, v1, &matrix); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/convert/linesegment.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #ifndef _DXF2VRML_LINE_SEGMENT_ 34 | #define _DXF2VRML_LINE_SEGMENT_ 35 | 36 | #include 37 | class dxfLayerData; 38 | 39 | class dxfLineSegment 40 | { 41 | public: 42 | void set(const dimeVec3f &p0, const dimeVec3f &p1, 43 | const dxfdouble startWidth, const dxfdouble endwidth, 44 | const dxfdouble thickness); 45 | void convert(dxfLineSegment *prev, dxfLineSegment *next, 46 | dxfLayerData *data, dimeMatrix *matrix); 47 | 48 | private: 49 | 50 | void calculate_v(); 51 | void calculate_connect(dxfLineSegment *next); 52 | 53 | dimeVec3f p[2]; 54 | dxfdouble w[2]; 55 | dxfdouble thickness; 56 | dxfLineSegment *prev; 57 | dimeVec3f e; 58 | dimeVec3f dir; 59 | dimeVec3f wdir; 60 | 61 | // calculated pts 62 | int flags; 63 | dimeVec3f v[4]; 64 | dimeVec3f connect[4]; 65 | }; 66 | 67 | 68 | #endif // _DXF2VRML_LINE_SEGMENT_ 69 | -------------------------------------------------------------------------------- /src/convert/pointconvert.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "convert_funcs.h" 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | void 40 | convert_point(const dimeEntity *entity, const dimeState *state, 41 | dxfLayerData *layerData, dxfConverter *) 42 | { 43 | dimePoint *point = (dimePoint*)entity; 44 | dimeVec3f v0 = point->getCoords(); 45 | 46 | dimeParam param; 47 | if (point->getRecord(38, param)) { 48 | v0[2] = param.double_data; 49 | } 50 | 51 | dimeMatrix matrix; 52 | state->getMatrix(matrix); 53 | 54 | dxfdouble thickness = point->getThickness(); 55 | if (thickness != 0.0) { // line 56 | dimeVec3f e = point->getExtrusionDir(); 57 | layerData->addLine(v0, v0 + thickness * e); 58 | } 59 | else { // point 60 | layerData->addPoint(v0); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/convert/traceconvert.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | #include "convert_funcs.h" 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | 41 | // 42 | // implementation in solid.cpp 43 | // 44 | extern void 45 | convert_solid_data(dimeVec3f *v, dimeVec3f &e, dxfdouble thickness, 46 | const dimeState *state, 47 | dxfLayerData *layerData); 48 | 49 | 50 | void 51 | convert_trace(const dimeEntity *entity, const dimeState *state, 52 | dxfLayerData *layerData, dxfConverter *converter) 53 | { 54 | dimeTrace *trace = (dimeTrace*)entity; 55 | 56 | // respect the value in the $FILLMODE header variable 57 | layerData->setFillmode(converter->getFillmode()); 58 | 59 | dimeVec3f v[4]; 60 | trace->getVertices(v[0], v[1], v[2], v[3]); 61 | 62 | dimeParam param; 63 | if (trace->getRecord(38, param)) { 64 | v[0][2] = param.double_data; 65 | v[1][2] = param.double_data; 66 | v[2][2] = param.double_data; 67 | v[3][2] = param.double_data; 68 | } 69 | 70 | dimeVec3f e; 71 | trace->getExtrusionDir(e); 72 | dxfdouble thickness = trace->getThickness(); 73 | 74 | convert_solid_data(v, e, thickness, state, layerData); 75 | } 76 | -------------------------------------------------------------------------------- /src/entities/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = entities.lst 8 | else 9 | noinst_LTLIBRARIES = libentities.la 10 | endif 11 | 12 | ## All source files used when building this submodule, including all 13 | ## headers. 14 | 15 | EntitiesSources = \ 16 | 3DFace.cpp 3DFace.h \ 17 | Arc.cpp Arc.h \ 18 | Block.cpp Block.h \ 19 | Circle.cpp Circle.h \ 20 | Ellipse.cpp Ellipse.h \ 21 | Entity.cpp Entity.h \ 22 | ExtrusionEntity.cpp ExtrusionEntity.h \ 23 | FaceEntity.cpp FaceEntity.h \ 24 | Insert.cpp Insert.h \ 25 | LWPolyline.cpp LWPolyline.h \ 26 | Line.cpp Line.h \ 27 | Point.cpp Point.h \ 28 | Polyline.cpp Polyline.h \ 29 | Solid.cpp Solid.h \ 30 | Spline.cpp Spline.h \ 31 | Trace.cpp Trace.h \ 32 | UnknownEntity.cpp UnknownEntity.h \ 33 | Vertex.cpp Vertex.h \ 34 | Text.cpp Text.h 35 | 36 | libentities_la_SOURCES = \ 37 | $(EntitiesSources) 38 | 39 | entities_lst_SOURCES = \ 40 | $(EntitiesSources) 41 | 42 | entities.lst: Makefile $(entities_lst_OBJECTS) 43 | @echo "Linking entities.lst..."; \ 44 | rm -f $@; \ 45 | for i in $(entities_lst_OBJECTS); do echo $$i >>$@; done 46 | 47 | ## Installation information. 48 | 49 | libentitiesincdir = $(includedir)/dime/entities 50 | 51 | libentitiesinc_HEADERS = \ 52 | ../../include/dime/entities/3DFace.h \ 53 | ../../include/dime/entities/Arc.h \ 54 | ../../include/dime/entities/Block.h \ 55 | ../../include/dime/entities/Circle.h \ 56 | ../../include/dime/entities/Ellipse.h \ 57 | ../../include/dime/entities/Entity.h \ 58 | ../../include/dime/entities/ExtrusionEntity.h \ 59 | ../../include/dime/entities/FaceEntity.h \ 60 | ../../include/dime/entities/Insert.h \ 61 | ../../include/dime/entities/LWPolyline.h \ 62 | ../../include/dime/entities/Line.h \ 63 | ../../include/dime/entities/Point.h \ 64 | ../../include/dime/entities/Polyline.h \ 65 | ../../include/dime/entities/Solid.h \ 66 | ../../include/dime/entities/Spline.h \ 67 | ../../include/dime/entities/Trace.h \ 68 | ../../include/dime/entities/UnknownEntity.h \ 69 | ../../include/dime/entities/Vertex.h \ 70 | ../../include/dime/entities/Text.h 71 | 72 | install-libentitiesincHEADERS: $(libentitiesinc_HEADERS) 73 | @$(NORMAL_INSTALL) 74 | $(mkinstalldirs) $(DESTDIR)$(libentitiesincdir) 75 | @list='$(libentitiesinc_HEADERS)'; for p in $$list; do \ 76 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 77 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 78 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libentitiesincdir)/$$f"; \ 79 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libentitiesincdir)/$$f; \ 80 | done 81 | 82 | uninstall-libentitiesincHEADERS: 83 | @$(NORMAL_UNINSTALL) 84 | @list='$(libentitiesinc_HEADERS)'; for p in $$list; do \ 85 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 86 | echo " rm -f $(DESTDIR)$(libentitiesincdir)/$$f"; \ 87 | rm -f $(DESTDIR)$(libentitiesincdir)/$$f; \ 88 | done 89 | 90 | -------------------------------------------------------------------------------- /src/objects/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = objects.lst 8 | else 9 | noinst_LTLIBRARIES = libobjects.la 10 | endif 11 | 12 | ## All source files used when building this submodule, including all 13 | ## headers. 14 | 15 | ObjectsSources = \ 16 | Object.cpp Object.h \ 17 | UnknownObject.cpp UnknownObject.h 18 | 19 | libobjects_la_SOURCES = \ 20 | $(ObjectsSources) 21 | 22 | objects_lst_SOURCES = \ 23 | $(ObjectsSources) 24 | 25 | objects.lst: Makefile $(objects_lst_OBJECTS) 26 | @echo "Linking objects.lst..."; \ 27 | rm -f $@; \ 28 | for i in $(objects_lst_OBJECTS); do echo $$i >>$@; done 29 | 30 | 31 | ## Installation information. 32 | 33 | libobjectsincdir = $(includedir)/dime/objects 34 | libobjectsinc_HEADERS = \ 35 | ../../include/dime/objects/Object.h \ 36 | ../../include/dime/objects/UnknownObject.h 37 | 38 | install-libobjectsincHEADERS: $(libobjectsinc_HEADERS) 39 | @$(NORMAL_INSTALL) 40 | $(mkinstalldirs) $(DESTDIR)$(libobjectsincdir) 41 | @list='$(libobjectsinc_HEADERS)'; for p in $$list; do \ 42 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 43 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 44 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libobjectsincdir)/$$f"; \ 45 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libobjectsincdir)/$$f; \ 46 | done 47 | 48 | uninstall-libobjectsincHEADERS: 49 | @$(NORMAL_UNINSTALL) 50 | @list='$(libobjectsinc_HEADERS)'; for p in $$list; do \ 51 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 52 | echo " rm -f $(DESTDIR)$(libobjectsincdir)/$$f"; \ 53 | rm -f $(DESTDIR)$(libobjectsincdir)/$$f; \ 54 | done 55 | 56 | -------------------------------------------------------------------------------- /src/records/FloatRecord.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeFloatRecord dime/records/FloatRecord.h 35 | \brief The dimeFloatRecord class is a container class for float records. 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | /*! 44 | Constructor 45 | */ 46 | 47 | dimeFloatRecord::dimeFloatRecord(const int group_code, const float val) 48 | : dimeRecord(group_code) 49 | { 50 | this->setValue(val); 51 | } 52 | 53 | //! 54 | 55 | dimeRecord * 56 | dimeFloatRecord::copy(dimeMemHandler * const mh) const 57 | { 58 | return new(mh) dimeFloatRecord(this->groupCode, this->value); 59 | } 60 | 61 | /*! 62 | Sets the float value. 63 | */ 64 | 65 | void 66 | dimeFloatRecord::setValue(const float val) 67 | { 68 | this->value = val; 69 | } 70 | 71 | //! 72 | 73 | float 74 | dimeFloatRecord::getValue() const 75 | { 76 | return this->value; 77 | } 78 | 79 | //! 80 | 81 | int 82 | dimeFloatRecord::typeId() const 83 | { 84 | return dimeBase::dimeFloatRecordType; 85 | } 86 | 87 | //! 88 | 89 | bool 90 | dimeFloatRecord::read(dimeInput * const in) 91 | { 92 | return in->readFloat(this->value); 93 | } 94 | 95 | //! 96 | 97 | bool 98 | dimeFloatRecord::write(dimeOutput * const out) 99 | { 100 | if (dimeRecord::write(out)) { 101 | return out->writeFloat(this->value); 102 | } 103 | return false; 104 | } 105 | 106 | //! 107 | 108 | void 109 | dimeFloatRecord::setValue(const dimeParam ¶m, dimeMemHandler * const) 110 | { 111 | this->value = param.float_data; 112 | } 113 | 114 | //! 115 | 116 | void 117 | dimeFloatRecord::getValue(dimeParam ¶m) const 118 | { 119 | param.float_data = this->value; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/records/HexRecord.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeHexRecord dime/records/HexRecord.h 35 | \brief The dimeHexRecord class is a container class for hex records. 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | /*! 46 | Constructor. 47 | */ 48 | 49 | dimeHexRecord::dimeHexRecord(const int group_code) 50 | : dimeStringRecord(group_code) 51 | { 52 | } 53 | 54 | //! 55 | 56 | int 57 | dimeHexRecord::typeId() const 58 | { 59 | return dimeBase::dimeHexRecordType; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/records/Int16Record.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeInt16Record dime/records/Int16Record.h 35 | \brief The dimeInt16Record class is a container class for 16-bit integer records. 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | /*! 44 | Constructor 45 | */ 46 | 47 | dimeInt16Record::dimeInt16Record(const int group_code, const int16 val) 48 | :dimeRecord(group_code) 49 | { 50 | this->setValue(val); 51 | } 52 | 53 | //! 54 | 55 | dimeRecord * 56 | dimeInt16Record::copy(dimeMemHandler * const mh) const 57 | { 58 | return new(mh) dimeInt16Record(this->groupCode, this->value); 59 | } 60 | 61 | /*! 62 | Sets the int16 value. 63 | */ 64 | 65 | void 66 | dimeInt16Record::setValue(const int16 val) 67 | { 68 | this->value = val; 69 | } 70 | 71 | /*! 72 | Returns the int16 value. 73 | */ 74 | 75 | int16 76 | dimeInt16Record::getValue() const 77 | { 78 | return this->value; 79 | } 80 | 81 | //! 82 | 83 | int 84 | dimeInt16Record::typeId() const 85 | { 86 | return dimeBase::dimeInt16RecordType; 87 | } 88 | 89 | //! 90 | 91 | bool 92 | dimeInt16Record::read(dimeInput * const in) 93 | { 94 | return in->readInt16(this->value); 95 | } 96 | 97 | //! 98 | 99 | bool 100 | dimeInt16Record::write(dimeOutput * const out) 101 | { 102 | if (dimeRecord::write(out)) { 103 | return out->writeInt16(this->value); 104 | } 105 | return false; 106 | } 107 | 108 | //! 109 | 110 | void 111 | dimeInt16Record::setValue(const dimeParam ¶m, dimeMemHandler * const ) 112 | { 113 | this->value = param.int16_data; 114 | } 115 | 116 | //! 117 | 118 | void 119 | dimeInt16Record::getValue(dimeParam ¶m) const 120 | { 121 | param.int16_data = this->value; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /src/records/Int32Record.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeInt32Record dime/records/Int32Record.h 35 | \brief The dimeInt32Record class is a container class for 32-bit integer records. 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | /*! 43 | Constructor 44 | */ 45 | 46 | dimeInt32Record::dimeInt32Record(const int group_code, const int32 val) 47 | : dimeRecord(group_code) 48 | { 49 | this->setValue(val); 50 | } 51 | 52 | //! 53 | 54 | dimeRecord * 55 | dimeInt32Record::copy(dimeMemHandler * const mh) const 56 | { 57 | return new(mh) dimeInt32Record(this->groupCode, this->value); 58 | } 59 | 60 | /*! 61 | Sets the int32 value to \a val. 62 | */ 63 | 64 | void 65 | dimeInt32Record::setValue(const int32 val) 66 | { 67 | this->value = val; 68 | } 69 | 70 | /*! 71 | Returns the int32 value. 72 | */ 73 | 74 | int32 75 | dimeInt32Record::getValue() const 76 | { 77 | return this->value; 78 | } 79 | 80 | //! 81 | 82 | int 83 | dimeInt32Record::typeId() const 84 | { 85 | return dimeBase::dimeInt32RecordType; 86 | } 87 | 88 | //! 89 | 90 | bool 91 | dimeInt32Record::read(dimeInput * const in) 92 | { 93 | return in->readInt32(this->value); 94 | } 95 | 96 | //! 97 | 98 | bool 99 | dimeInt32Record::write(dimeOutput * const out) 100 | { 101 | if (dimeRecord::write(out)) { 102 | return out->writeInt32(this->value); 103 | } 104 | return false; 105 | } 106 | 107 | //! 108 | 109 | void 110 | dimeInt32Record::setValue(const dimeParam ¶m, dimeMemHandler * const ) 111 | { 112 | this->value = param.int32_data; 113 | } 114 | 115 | //! 116 | 117 | void 118 | dimeInt32Record::getValue(dimeParam ¶m) const 119 | { 120 | param.int32_data = this->value; 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src/records/Int8Record.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************\ 2 | * Copyright (c) Kongsberg Oil & Gas Technologies AS 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | \**************************************************************************/ 32 | 33 | /*! 34 | \class dimeInt8Record dime/records/Int8Record.h 35 | \brief The dimeInt8Record class is a container class for 8-bit integer records. 36 | */ 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | /*! 44 | Constructor 45 | */ 46 | 47 | dimeInt8Record::dimeInt8Record(const int group_code, const int8 val) 48 | : dimeRecord(group_code) 49 | { 50 | this->setValue(val); 51 | } 52 | 53 | //! 54 | 55 | dimeRecord * 56 | dimeInt8Record::copy(dimeMemHandler * const mh) const 57 | { 58 | return new(mh) dimeInt8Record(this->groupCode, this->value); 59 | } 60 | 61 | /*! 62 | Sets the value. 63 | */ 64 | 65 | void 66 | dimeInt8Record::setValue(const int8 val) 67 | { 68 | this->value = val; 69 | } 70 | 71 | /*! 72 | Returns the int8 value. 73 | */ 74 | 75 | int8 76 | dimeInt8Record::getValue() const 77 | { 78 | return this->value; 79 | } 80 | 81 | //! 82 | 83 | int 84 | dimeInt8Record::typeId() const 85 | { 86 | return dimeBase::dimeInt8RecordType; 87 | } 88 | 89 | //! 90 | 91 | bool 92 | dimeInt8Record::read(dimeInput * const in) 93 | { 94 | return in->readInt8(this->value); 95 | } 96 | 97 | //! 98 | 99 | bool 100 | dimeInt8Record::write(dimeOutput * const out) 101 | { 102 | if (dimeRecord::write(out)) { 103 | return out->writeInt8(this->value); 104 | } 105 | return false; 106 | } 107 | 108 | //! 109 | 110 | void 111 | dimeInt8Record::setValue(const dimeParam ¶m, dimeMemHandler * const ) 112 | { 113 | this->value = param.int8_data; 114 | } 115 | 116 | //! 117 | 118 | void 119 | dimeInt8Record::getValue(dimeParam ¶m) const 120 | { 121 | param.int8_data = this->value; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /src/records/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = records.lst 8 | else 9 | noinst_LTLIBRARIES = librecords.la 10 | endif 11 | 12 | RecordsSources = \ 13 | DoubleRecord.cpp DoubleRecord.h \ 14 | FloatRecord.cpp FloatRecord.h \ 15 | HexRecord.cpp HexRecord.h \ 16 | Int16Record.cpp Int16Record.h \ 17 | Int32Record.cpp Int32Record.h \ 18 | Int8Record.cpp Int8Record.h \ 19 | Record.cpp Record.h \ 20 | StringRecord.cpp StringRecord.h 21 | 22 | librecords_la_SOURCES = \ 23 | $(RecordsSources) 24 | 25 | records_lst_SOURCES = \ 26 | $(RecordsSources) 27 | 28 | records.lst: Makefile $(records_lst_OBJECTS) 29 | @echo "Linking records.lst..."; \ 30 | rm -f $@; \ 31 | for i in $(records_lst_OBJECTS); do echo $$i >>$@; done 32 | 33 | 34 | ## Installation information. 35 | 36 | librecordsincdir = $(includedir)/dime/records 37 | librecordsinc_HEADERS = \ 38 | ../../include/dime/records/DoubleRecord.h \ 39 | ../../include/dime/records/FloatRecord.h \ 40 | ../../include/dime/records/HexRecord.h \ 41 | ../../include/dime/records/Int16Record.h \ 42 | ../../include/dime/records/Int32Record.h \ 43 | ../../include/dime/records/Int8Record.h \ 44 | ../../include/dime/records/Record.h \ 45 | ../../include/dime/records/StringRecord.h 46 | 47 | install-librecordsincHEADERS: $(librecordsinc_HEADERS) 48 | @$(NORMAL_INSTALL) 49 | $(mkinstalldirs) $(DESTDIR)$(librecordsincdir) 50 | @list='$(librecordsinc_HEADERS)'; for p in $$list; do \ 51 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 52 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 53 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(librecordsincdir)/$$f"; \ 54 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(librecordsincdir)/$$f; \ 55 | done 56 | 57 | uninstall-librecordsincHEADERS: 58 | @$(NORMAL_UNINSTALL) 59 | @list='$(librecordsinc_HEADERS)'; for p in $$list; do \ 60 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 61 | echo " rm -f $(DESTDIR)$(librecordsincdir)/$$f"; \ 62 | rm -f $(DESTDIR)$(librecordsincdir)/$$f; \ 63 | done 64 | 65 | -------------------------------------------------------------------------------- /src/sections/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = sections.lst 8 | else 9 | noinst_LTLIBRARIES = libsections.la 10 | endif 11 | 12 | ## All source files used when building this submodule, including all 13 | ## headers. 14 | 15 | SectionsSources = \ 16 | BlocksSection.cpp BlocksSection.h \ 17 | ClassesSection.cpp ClassesSection.h \ 18 | EntitiesSection.cpp EntitiesSection.h \ 19 | HeaderSection.cpp HeaderSection.h \ 20 | ObjectsSection.cpp ObjectsSection.h \ 21 | Section.cpp Section.h \ 22 | TablesSection.cpp TablesSection.h \ 23 | UnknownSection.cpp UnknownSection.h 24 | 25 | libsections_la_SOURCES = \ 26 | $(SectionsSources) 27 | 28 | sections_lst_SOURCES = \ 29 | $(SectionsSources) 30 | 31 | sections.lst: Makefile $(sections_lst_OBJECTS) 32 | @echo "Linking sections.lst..."; \ 33 | rm -f $@; \ 34 | for i in $(sections_lst_OBJECTS); do echo $$i >>$@; done 35 | 36 | ## Installation information. 37 | 38 | libsectionsincdir = $(includedir)/dime/sections 39 | libsectionsinc_HEADERS = \ 40 | ../../include/dime/sections/BlocksSection.h \ 41 | ../../include/dime/sections/ClassesSection.h \ 42 | ../../include/dime/sections/EntitiesSection.h \ 43 | ../../include/dime/sections/HeaderSection.h \ 44 | ../../include/dime/sections/ObjectsSection.h \ 45 | ../../include/dime/sections/Section.h \ 46 | ../../include/dime/sections/TablesSection.h \ 47 | ../../include/dime/sections/UnknownSection.h 48 | 49 | install-libsectionsincHEADERS: $(libsectionsinc_HEADERS) 50 | @$(NORMAL_INSTALL) 51 | $(mkinstalldirs) $(DESTDIR)$(libsectionsincdir) 52 | @list='$(libsectionsinc_HEADERS)'; for p in $$list; do \ 53 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 54 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 55 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libsectionsincdir)/$$f"; \ 56 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libsectionsincdir)/$$f; \ 57 | done 58 | 59 | uninstall-libsectionsincHEADERS: 60 | @$(NORMAL_UNINSTALL) 61 | @list='$(libsectionsinc_HEADERS)'; for p in $$list; do \ 62 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 63 | echo " rm -f $(DESTDIR)$(libsectionsincdir)/$$f"; \ 64 | rm -f $(DESTDIR)$(libsectionsincdir)/$$f; \ 65 | done 66 | 67 | -------------------------------------------------------------------------------- /src/tables/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = tables.lst 8 | else 9 | noinst_LTLIBRARIES = libtables.la 10 | endif 11 | 12 | ## All source files used when building this submodule, including all 13 | ## headers. 14 | 15 | TablesSources = \ 16 | LayerTable.cpp LayerTable.h \ 17 | Table.cpp Table.h \ 18 | TableEntry.cpp TableEntry.h \ 19 | UCSTable.cpp UCSTable.h \ 20 | UnknownTable.cpp UnknownTable.h 21 | 22 | libtables_la_SOURCES = \ 23 | $(TablesSources) 24 | 25 | tables_lst_SOURCES = \ 26 | $(TablesSources) 27 | 28 | tables.lst: Makefile $(tables_lst_OBJECTS) 29 | @echo "Linking tables.lst..."; \ 30 | rm -f $@; \ 31 | for i in $(tables_lst_OBJECTS); do echo $$i >>$@; done 32 | 33 | libtablesincdir = $(includedir)/dime/tables 34 | libtablesinc_HEADERS = \ 35 | ../../include/dime/tables/LayerTable.h \ 36 | ../../include/dime/tables/Table.h \ 37 | ../../include/dime/tables/TableEntry.h \ 38 | ../../include/dime/tables/UCSTable.h \ 39 | ../../include/dime/tables/UnknownTable.h 40 | 41 | install-libtablesincHEADERS: $(libtablesinc_HEADERS) 42 | @$(NORMAL_INSTALL) 43 | $(mkinstalldirs) $(DESTDIR)$(libtablesincdir) 44 | @list='$(libtablesinc_HEADERS)'; for p in $$list; do \ 45 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 46 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 47 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libtablesincdir)/$$f"; \ 48 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libtablesincdir)/$$f; \ 49 | done 50 | 51 | uninstall-libtablesincHEADERS: 52 | @$(NORMAL_UNINSTALL) 53 | @list='$(libtablesinc_HEADERS)'; for p in $$list; do \ 54 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 55 | echo " rm -f $(DESTDIR)$(libtablesincdir)/$$f"; \ 56 | rm -f $(DESTDIR)$(libtablesincdir)/$$f; \ 57 | done 58 | 59 | -------------------------------------------------------------------------------- /src/util/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to generate Makefile.in. 2 | 3 | LIBS = 4 | INCLUDES = -I$(top_srcdir)/include 5 | 6 | if BUILD_WITH_MSVC 7 | noinst_LIBRARIES = util.lst 8 | else 9 | noinst_LTLIBRARIES = libutil.la 10 | endif 11 | 12 | UtilSources = \ 13 | Array.cpp Array.h \ 14 | BSPTree.cpp BSPTree.h \ 15 | Box.cpp Box.h \ 16 | Dict.cpp Dict.h \ 17 | Linear.cpp Linear.h \ 18 | MemHandler.cpp MemHandler.h 19 | 20 | libutil_la_SOURCES = \ 21 | $(UtilSources) 22 | 23 | util_lst_SOURCES = \ 24 | $(UtilSources) 25 | 26 | util.lst: Makefile $(util_lst_OBJECTS) 27 | @echo "Linking util.lst..."; \ 28 | rm -f $@; \ 29 | for i in $(util_lst_OBJECTS); do echo $$i >>$@; done 30 | 31 | ## Installation information. 32 | 33 | libutilincdir = $(includedir)/dime/util 34 | libutilinc_HEADERS = \ 35 | ../../include/dime/util/Array.h \ 36 | ../../include/dime/util/BSPTree.h \ 37 | ../../include/dime/util/Box.h \ 38 | ../../include/dime/util/Dict.h \ 39 | ../../include/dime/util/Linear.h \ 40 | ../../include/dime/util/MemHandler.h 41 | 42 | install-libutilincHEADERS: $(libutilinc_HEADERS) 43 | @$(NORMAL_INSTALL) 44 | $(mkinstalldirs) $(DESTDIR)$(libutilincdir) 45 | @list='$(libutilinc_HEADERS)'; for p in $$list; do \ 46 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ 47 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 48 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libutilincdir)/$$f"; \ 49 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libutilincdir)/$$f; \ 50 | done 51 | 52 | uninstall-libutilincHEADERS: 53 | @$(NORMAL_UNINSTALL) 54 | @list='$(libutilinc_HEADERS)'; for p in $$list; do \ 55 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 56 | echo " rm -f $(DESTDIR)$(libutilincdir)/$$f"; \ 57 | rm -f $(DESTDIR)$(libutilincdir)/$$f; \ 58 | done 59 | 60 | -------------------------------------------------------------------------------- /testfiles/Bug1/README.txt: -------------------------------------------------------------------------------- 1 | Without the change of src/convert/polylineconvert.cpp 2 | dxf2vrml generates a file such as testFile_Bug01_original.wrl, 3 | where the clockwise bulge is not at the correct position. 4 | 5 | With the change, the bulge is o.k., which does not mean that 6 | the changed version of polylineconvert.cpp handles all possible 7 | cases correctly. It worked for all files I tried, however. 8 | -------------------------------------------------------------------------------- /testfiles/Bug1/testFile_Bug01.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | POLYLINE 7 | 5 8 | 205 9 | 8 10 | 0 11 | 66 12 | 1 13 | 10 14 | 0.0 15 | 20 16 | 0.0 17 | 30 18 | 0.0 19 | 0 20 | VERTEX 21 | 5 22 | 279 23 | 8 24 | 0 25 | 10 26 | -176.07272753254799 27 | 20 28 | -907.11665722290854 29 | 30 30 | 0.0 31 | 0 32 | VERTEX 33 | 5 34 | 27A 35 | 8 36 | 0 37 | 10 38 | -176.07272753254799 39 | 20 40 | -157.11665722290871 41 | 30 42 | 0.0 43 | 42 44 | -0.4142135623730951 45 | 0 46 | VERTEX 47 | 5 48 | 27B 49 | 8 50 | 0 51 | 10 52 | 73.927272467451957 53 | 20 54 | 92.883342777091343 55 | 30 56 | 0.0 57 | 0 58 | VERTEX 59 | 5 60 | 27C 61 | 8 62 | 0 63 | 10 64 | 573.92727246745198 65 | 20 66 | 92.883342777091343 67 | 30 68 | 0.0 69 | 42 70 | 0.4142135623730951 71 | 0 72 | VERTEX 73 | 5 74 | 27D 75 | 8 76 | 0 77 | 10 78 | 823.92727246745187 79 | 20 80 | 342.88334277709129 81 | 30 82 | 0.0 83 | 0 84 | VERTEX 85 | 5 86 | 27E 87 | 8 88 | 0 89 | 10 90 | 823.92727246745187 91 | 20 92 | 1092.883342777091 93 | 30 94 | 0.0 95 | 0 96 | SEQEND 97 | 5 98 | 27F 99 | 8 100 | 0 101 | 0 102 | ENDSEC 103 | 0 104 | EOF 105 | -------------------------------------------------------------------------------- /testfiles/Bug1/testFile_Bug01.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | Coordinate3 { 9 | point [ 10 | -176.07272 -907.11664 0, 11 | -176.07272 -157.11665 0, 12 | 73.927269 92.883362 0, 13 | 63.596024 92.6698 0, 14 | 53.282429 92.029488 0, 15 | 43.004105 90.963509 0, 16 | 32.778614 89.473686 0, 17 | 22.623425 87.562569 0, 18 | 12.555887 85.233429 0, 19 | 2.5932012 82.490227 0, 20 | -7.2476115 79.337669 0, 21 | -16.949738 75.781128 0, 22 | -26.496603 71.826683 0, 23 | -35.871895 67.481102 0, 24 | -45.059597 62.751789 0, 25 | -54.044014 57.646839 0, 26 | -62.809792 52.174969 0, 27 | -71.341957 46.345528 0, 28 | -79.625931 40.168472 0, 29 | -87.64756 33.654358 0, 30 | -95.39315 26.814318 0, 31 | -102.84945 19.660034 0, 32 | -110.00373 12.203729 0, 33 | -116.84377 4.4581432 0, 34 | -123.35788 -3.5634904 0, 35 | -129.53493 -11.847467 0, 36 | -135.36438 -20.379633 0, 37 | -140.83624 -29.145414 0, 38 | -145.94119 -38.129829 0, 39 | -150.6705 -47.317532 0, 40 | -155.01608 -56.692825 0, 41 | -158.97052 -66.239693 0, 42 | -162.52705 -75.941818 0, 43 | -165.67961 -85.782631 0, 44 | -168.42281 -95.745323 0, 45 | -170.75195 -105.81286 0, 46 | -172.66307 -115.96805 0, 47 | -174.15288 -126.19354 0, 48 | -175.21886 -136.47186 0, 49 | -175.85918 -146.78546 0, 50 | -176.07272 -157.1167 0, 51 | 73.927269 92.883347 0, 52 | 573.92725 92.883347 0, 53 | 587.46198 93.249992 0, 54 | 600.95697 94.348854 0, 55 | 614.37274 96.176712 0, 56 | 627.66986 98.72821 0, 57 | 640.80933 101.99585 0, 58 | 653.75262 105.97005 0, 59 | 666.46179 110.63917 0, 60 | 678.89954 115.98949 0, 61 | 691.02936 122.00533 0, 62 | 702.81567 128.66905 0, 63 | 714.224 135.96109 0, 64 | 725.22076 143.86008 0, 65 | 735.7738 152.34283 0, 66 | 745.85211 161.38448 0, 67 | 755.42609 170.95848 0, 68 | 764.46777 181.03677 0, 69 | 772.9505 191.58978 0, 70 | 780.84949 202.58658 0, 71 | 788.14154 213.99487 0, 72 | 794.80524 225.78123 0, 73 | 800.82111 237.91106 0, 74 | 806.17139 250.3488 0, 75 | 810.84052 263.05795 0, 76 | 814.81476 276.00125 0, 77 | 818.0824 289.14072 0, 78 | 820.63385 302.43784 0, 79 | 822.46173 315.85358 0, 80 | 823.56061 329.3486 0, 81 | 823.92725 342.88333 0, 82 | 823.92725 1092.8833 0 83 | ] 84 | } 85 | IndexedLineSet { 86 | coordIndex [ 87 | 0,1,-1,2,3,4,5,6, 88 | 7,8,9,10,11,12,13,14, 89 | 15,16,17,18,19,20,21,22, 90 | 23,24,25,26,27,28,29,30, 91 | 31,32,33,34,35,36,37,38, 92 | 39,40,-1,41,42,43,44,45, 93 | 46,47,48,49,50,51,52,53, 94 | 54,55,56,57,58,59,60,61, 95 | 62,63,64,65,66,67,68,69, 96 | 70,71,72,-1 97 | ] 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /testfiles/Bug1/testFile_Bug01_original.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | Coordinate3 { 9 | point [ 10 | -176.07272 -907.11664 0, 11 | -176.07272 -157.11665 0, 12 | -176.07272 342.88333 0, 13 | -189.60745 342.51669 0, 14 | -203.10248 341.41782 0, 15 | -216.51822 339.58997 0, 16 | -229.81534 337.03848 0, 17 | -242.9548 333.77084 0, 18 | -255.8981 329.79663 0, 19 | -268.60727 325.12753 0, 20 | -281.04501 319.77719 0, 21 | -293.17484 313.76135 0, 22 | -304.96118 307.09763 0, 23 | -316.36948 299.8056 0, 24 | -327.36627 291.90662 0, 25 | -337.91928 283.42386 0, 26 | -347.99759 274.3822 0, 27 | -357.57159 264.8082 0, 28 | -366.61325 254.7299 0, 29 | -375.09598 244.1769 0, 30 | -382.99496 233.1801 0, 31 | -390.28702 221.7718 0, 32 | -396.95074 209.98544 0, 33 | -402.96658 197.85562 0, 34 | -408.31689 185.41788 0, 35 | -412.98602 172.70872 0, 36 | -416.96024 159.76543 0, 37 | -420.22787 146.62595 0, 38 | -422.77936 133.32884 0, 39 | -424.60721 119.91309 0, 40 | -425.70609 106.41807 0, 41 | -426.07272 92.883339 0, 42 | 73.927269 92.883347 0, 43 | 573.92725 92.883347 0, 44 | 587.46198 93.249992 0, 45 | 600.95697 94.348854 0, 46 | 614.37274 96.176712 0, 47 | 627.66986 98.72821 0, 48 | 640.80933 101.99585 0, 49 | 653.75262 105.97005 0, 50 | 666.46179 110.63917 0, 51 | 678.89954 115.98949 0, 52 | 691.02936 122.00533 0, 53 | 702.81567 128.66905 0, 54 | 714.224 135.96109 0, 55 | 725.22076 143.86008 0, 56 | 735.7738 152.34283 0, 57 | 745.85211 161.38448 0, 58 | 755.42609 170.95848 0, 59 | 764.46777 181.03677 0, 60 | 772.9505 191.58978 0, 61 | 780.84949 202.58658 0, 62 | 788.14154 213.99487 0, 63 | 794.80524 225.78123 0, 64 | 800.82111 237.91106 0, 65 | 806.17139 250.3488 0, 66 | 810.84052 263.05795 0, 67 | 814.81476 276.00125 0, 68 | 818.0824 289.14072 0, 69 | 820.63385 302.43784 0, 70 | 822.46173 315.85358 0, 71 | 823.56061 329.3486 0, 72 | 823.92725 342.88333 0, 73 | 823.92725 1092.8833 0 74 | ] 75 | } 76 | IndexedLineSet { 77 | coordIndex [ 78 | 0,1,-1,2,3,4,5,6, 79 | 7,8,9,10,11,12,13,14, 80 | 15,16,17,18,19,20,21,22, 81 | 23,24,25,26,27,28,29,30, 82 | 31,-1,32,33,34,35,36,37, 83 | 38,39,40,41,42,43,44,45, 84 | 46,47,48,49,50,51,52,53, 85 | 54,55,56,57,58,59,60,61, 86 | 62,63,-1 87 | ] 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /testfiles/Bug2/README.txt: -------------------------------------------------------------------------------- 1 | Before the change in src/convert/linesegment.cpp, 2 | the file testFile_Bug02_original.wrl contains very 3 | large numbers. 4 | After the change, a file like testFile_Bug02.wrl is 5 | created by dxf2vrml, which has no large numbers in it. 6 | 7 | -------------------------------------------------------------------------------- /testfiles/Bug2/testFile_Bug02.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LWPOLYLINE 7 | 90 8 | 2 9 | 70 10 | 1 11 | 43 12 | 0.1 13 | 10 14 | -0.0344 15 | 20 16 | -0.0362133551388979 17 | 10 18 | 0.0344 19 | 20 20 | 0.0362133542075753 21 | 0 22 | ENDSEC 23 | 0 24 | EOF 25 | -------------------------------------------------------------------------------- /testfiles/Bug2/testFile_Bug02.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | ShapeHints { 9 | creaseAngle 0.5 10 | vertexOrdering COUNTERCLOCKWISE 11 | shapeType UNKNOWN_SHAPE_TYPE 12 | faceType UNKNOWN_FACE_TYPE 13 | } 14 | Coordinate3 { 15 | point [ 16 | 0.038102627 -0.10508548 0, 17 | -0.038102627 0.10508547 0, 18 | 0.10690263 -0.032658763 0, 19 | -0.10690263 0.03265876 0 20 | ] 21 | } 22 | IndexedFaceSet { 23 | coordIndex [ 24 | 0,1,2,3,-1,1,0,3, 25 | 2,-1 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testfiles/Bug2/testFile_Bug02_original.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | ShapeHints { 9 | creaseAngle 0.5 10 | vertexOrdering COUNTERCLOCKWISE 11 | shapeType UNKNOWN_SHAPE_TYPE 12 | faceType UNKNOWN_FACE_TYPE 13 | } 14 | Coordinate3 { 15 | point [ 16 | 2951843.2 3107446.2 0, 17 | 2951843.5 3107446 0, 18 | 2951843.5 3107446.5 0, 19 | 0.038102627 -0.10508548 0, 20 | -0.10690263 0.03265876 0 21 | ] 22 | } 23 | IndexedFaceSet { 24 | coordIndex [ 25 | 0,1,2,1,-1,1,3,4, 26 | 2,-1 27 | ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /testfiles/Bug3/README.txt: -------------------------------------------------------------------------------- 1 | 2 | dxf2vrml testFile_Bug03.dxf -o test.wrl 3 | 4 | Unable to read record data for groupcode: 11 5 | Error reading entity: 0. 6 | DXF loading failed at line: 17 7 | DXF read error in line: 17 8 | 9 | The problem is a "nan" in the dxf file, which is 10 | probably not allowed according to the DXF specification. 11 | Still it would be nice if dime would discard the corrupted 12 | entity and go on reading. 13 | -------------------------------------------------------------------------------- /testfiles/Bug3/testFile_Bug03.dxf: -------------------------------------------------------------------------------- 1 | 999 2 | dxflib 2.0.4.8 3 | 0 4 | SECTION 5 | 2 6 | ENTITIES 7 | 0 8 | LINE 9 | 8 10 | 0 11 | 10 12 | 0.0 13 | 20 14 | 0.0 15 | 30 16 | 0.0 17 | 11 18 | nan 19 | 21 20 | 40.0 21 | 31 22 | 0.0 23 | 0 24 | LINE 25 | 8 26 | 0 27 | 10 28 | 0.0 29 | 20 30 | 0.0 31 | 30 32 | 0.0 33 | 11 34 | 70.0 35 | 21 36 | 40.0 37 | 31 38 | 0.0 39 | 0 40 | ENDSEC 41 | 0 42 | EOF 43 | -------------------------------------------------------------------------------- /testfiles/Bug4/README.txt: -------------------------------------------------------------------------------- 1 | dxf2vrml testFile_Bug04.dxf -o testFile_Bug04.wrl 2 | 3 | leads to lines in "testFile_Bug04.wrl", which are 4 | distorted due to rounding/cut-off errors due to 5 | single precision operations. 6 | 7 | One solution may be to perform any transformations 8 | required for the INSERT-entities in double precision and converting 9 | to single precision as the last step when all transformations are done. 10 | -------------------------------------------------------------------------------- /testfiles/Bug4/testFile_Bug04.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | BLOCKS 5 | 0 6 | BLOCK 7 | 2 8 | BASE0 9 | 0 10 | LINE 11 | 6 12 | CONTINUOUS 13 | 10 14 | 294314.8684630795032717 15 | 20 16 | 7444196.4985870467498899 17 | 30 18 | 0.0 19 | 11 20 | 294318.5979498365777545 21 | 21 22 | 7444195.1921829162165523 23 | 31 24 | 0.0 25 | 0 26 | LINE 27 | 6 28 | CONTINUOUS 29 | 10 30 | 294318.4921595192281529 31 | 20 32 | 7444194.8901756163686514 33 | 30 34 | 0.0 35 | 11 36 | 294314.4606654631788842 37 | 21 38 | 7444196.3023700648918748 39 | 31 40 | 0.0 41 | 0 42 | LINE 43 | 6 44 | CONTINUOUS 45 | 10 46 | 294318.4921595192281529 47 | 20 48 | 7444194.8901756163686514 49 | 30 50 | 0.0 51 | 11 52 | 294318.5979498365777545 53 | 21 54 | 7444195.1921829162165523 55 | 31 56 | 0.0 57 | 0 58 | ENDBLK 59 | 0 60 | ENDSEC 61 | 0 62 | SECTION 63 | 2 64 | ENTITIES 65 | 0 66 | INSERT 67 | 2 68 | BASE0 69 | 10 70 | -294318.5979498365777545 71 | 20 72 | -7444195.1921829162165523 73 | 30 74 | 0.0 75 | 0 76 | ENDSEC 77 | 0 78 | EOF 79 | -------------------------------------------------------------------------------- /testfiles/Bug4/testFile_Bug04.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | Coordinate3 { 9 | point [ 10 | -3.71875 1.5 0, 11 | 0 0 0, 12 | -0.09375 0 0, 13 | -4.125 1.5 0 14 | ] 15 | } 16 | IndexedLineSet { 17 | coordIndex [ 18 | 0,1,-1,2,3,-1,2,1, 19 | -1 20 | ] 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /testfiles/Bug5/README.txt: -------------------------------------------------------------------------------- 1 | Without the change of src/convert/ellipseconvert.cpp 2 | 3 | dxf2vrml testFile_Bug05.dxf -o testFile_Bug05.wrl 4 | 5 | does not stop and allocates more and more memory. 6 | 7 | With the change, dxf2vrml comes to an end, but I am not 8 | 100% sure if the resulting wrl file "testFile_Bug05.wrl" 9 | is correct and whether the function convert_ellipse works 10 | as planned by the authors. 11 | -------------------------------------------------------------------------------- /testfiles/Bug5/testFile_Bug05.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | ELLIPSE 7 | 10 8 | 0.0 9 | 20 10 | 0.0 11 | 30 12 | 0.0 13 | 11 14 | 2600.0 15 | 21 16 | 0.0 17 | 31 18 | 0.0 19 | 210 20 | 0.0 21 | 220 22 | 0.0 23 | 230 24 | 1.0 25 | 40 26 | 1.0 27 | 41 28 | 4.368 29 | 42 30 | 4.373 31 | 0 32 | ENDSEC 33 | 0 34 | EOF 35 | -------------------------------------------------------------------------------- /testfiles/Bug5/testFile_Bug05.wrl: -------------------------------------------------------------------------------- 1 | #VRML V1.0 ascii 2 | 3 | Separator { 4 | Separator { 5 | Material { 6 | diffuseColor 1 1 1 7 | } 8 | Coordinate3 { 9 | point [ 10 | -438.90805 -1223.6665 0, 11 | -432.78412 -1225.8458 0 12 | ] 13 | } 14 | IndexedLineSet { 15 | coordIndex [ 16 | 0,1,-1 17 | ] 18 | } 19 | } 20 | } 21 | --------------------------------------------------------------------------------