├── .gitmodules ├── BUGS ├── CMakeLists.txt ├── CMakeModules └── FindSISL.cmake ├── INSTALL ├── LICENSE ├── NOTES.cutouts ├── README.md ├── README.testing.md ├── TODO ├── patches └── 0001-sisl.patch ├── recipe ├── bld.bat └── meta.yaml ├── samples └── idftest │ ├── NOTES.idf │ ├── arduino-due.emn │ ├── arduino-due.emp │ ├── crescent.emn │ ├── crescent.emp │ ├── cylinder.emn │ ├── cylinder.emp │ ├── overlap.emn │ ├── overlap.emp │ ├── pic_programmer.emn │ ├── pic_programmer.emp │ ├── test_other_outline.emn │ ├── test_other_outline.emp │ ├── test_out0.emn │ ├── test_out0.emp │ ├── test_out1.emn │ ├── test_out1.emp │ ├── test_out2.emn │ ├── test_out2.emp │ ├── test_out3.emn │ ├── test_out3.emp │ ├── test_outline.emn │ ├── test_outline.emp │ ├── test_strange.emn │ ├── test_strange.emp │ ├── video.emn │ └── video.emp ├── sisl_exports.def ├── src ├── CMakeLists.txt ├── dllapi │ ├── README │ ├── dll_entity100.cpp │ ├── dll_entity102.cpp │ ├── dll_entity104.cpp │ ├── dll_entity110.cpp │ ├── dll_entity120.cpp │ ├── dll_entity122.cpp │ ├── dll_entity124.cpp │ ├── dll_entity126.cpp │ ├── dll_entity128.cpp │ ├── dll_entity142.cpp │ ├── dll_entity144.cpp │ ├── dll_entity308.cpp │ ├── dll_entity314.cpp │ ├── dll_entity406.cpp │ ├── dll_entity408.cpp │ ├── dll_iges.cpp │ ├── dll_iges_curve.cpp │ ├── dll_iges_entity.cpp │ ├── dll_iges_geom_pcb.cpp │ ├── dll_mcad_outline.cpp │ └── dll_mcad_segment.cpp ├── entities │ ├── CMakeLists.txt │ ├── entity100.cpp │ ├── entity102.cpp │ ├── entity104.cpp │ ├── entity108.cpp │ ├── entity110.cpp │ ├── entity120.cpp │ ├── entity122.cpp │ ├── entity124.cpp │ ├── entity126.cpp │ ├── entity128.cpp │ ├── entity142.cpp │ ├── entity144.cpp │ ├── entity154.cpp │ ├── entity164.cpp │ ├── entity180.cpp │ ├── entity186.cpp │ ├── entity308.cpp │ ├── entity314.cpp │ ├── entity406.cpp │ ├── entity408.cpp │ ├── entity502.cpp │ ├── entity504.cpp │ ├── entity508.cpp │ ├── entity510.cpp │ ├── entity514.cpp │ ├── entityNULL.cpp │ ├── entity_template.cpp │ ├── iges_curve.cpp │ └── iges_entity.cpp ├── geom │ ├── geom_cylinder.cpp │ ├── geom_wall.cpp │ ├── iges_geom_pcb.cpp │ ├── mcad_elements.cpp │ ├── mcad_helpers.cpp │ ├── mcad_outline.cpp │ └── mcad_segment.cpp ├── idf │ ├── CMakeLists.txt │ ├── gpl-2.0.txt │ ├── idf2igs.cpp │ ├── idf_common.cpp │ ├── idf_common.h │ ├── idf_helpers.cpp │ ├── idf_helpers.h │ ├── idf_outlines.cpp │ ├── idf_outlines.h │ ├── idf_parser.cpp │ └── idf_parser.h ├── iges │ ├── CMakeLists.txt │ ├── iges.cpp │ ├── iges_io.cpp │ └── mcad_utils.cpp ├── include │ ├── api │ │ ├── all_api_entities.h │ │ ├── dll_entity100.h │ │ ├── dll_entity102.h │ │ ├── dll_entity104.h │ │ ├── dll_entity110.h │ │ ├── dll_entity120.h │ │ ├── dll_entity122.h │ │ ├── dll_entity124.h │ │ ├── dll_entity126.h │ │ ├── dll_entity128.h │ │ ├── dll_entity142.h │ │ ├── dll_entity144.h │ │ ├── dll_entity308.h │ │ ├── dll_entity314.h │ │ ├── dll_entity406.h │ │ ├── dll_entity408.h │ │ ├── dll_iges.h │ │ ├── dll_iges_curve.h │ │ ├── dll_iges_entity.h │ │ ├── dll_iges_geom_pcb.h │ │ ├── dll_mcad_outline.h │ │ └── dll_mcad_segment.h │ ├── core │ │ ├── all_entities.h │ │ ├── entity100.h │ │ ├── entity102.h │ │ ├── entity104.h │ │ ├── entity108.h │ │ ├── entity110.h │ │ ├── entity120.h │ │ ├── entity122.h │ │ ├── entity124.h │ │ ├── entity126.h │ │ ├── entity128.h │ │ ├── entity142.h │ │ ├── entity144.h │ │ ├── entity154.h │ │ ├── entity164.h │ │ ├── entity180.h │ │ ├── entity184.h │ │ ├── entity186.h │ │ ├── entity308.h │ │ ├── entity314.h │ │ ├── entity406.h │ │ ├── entity408.h │ │ ├── entity430.h │ │ ├── entity502.h │ │ ├── entity504.h │ │ ├── entity508.h │ │ ├── entity510.h │ │ ├── entity514.h │ │ ├── entityNULL.h │ │ ├── entity_template.h │ │ ├── iges.h │ │ ├── iges_base.h │ │ ├── iges_curve.h │ │ ├── iges_entity.h │ │ └── iges_io.h │ ├── error_macros.h │ └── geom │ │ ├── geom_cylinder.h │ │ ├── geom_wall.h │ │ ├── iges_geom_pcb.h │ │ ├── mcad_elements.h │ │ ├── mcad_helpers.h │ │ ├── mcad_outline.h │ │ ├── mcad_segment.h │ │ └── mcad_utils.h ├── libigesconf.h.in └── tests │ ├── test_circle.cpp │ ├── test_curves.cpp │ ├── test_merge.cpp │ ├── test_outline.cpp │ ├── test_plane.cpp │ ├── test_read.cpp │ └── test_segs.cpp └── tutorial └── src ├── CMakeLists.txt └── tutorial1.cpp /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/sisl"] 2 | path = sisl 3 | url = https://github.com/SINTEF-Geometry/SISL.git 4 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | Known bugs: 2 | 3 | Sep 26 2015: 4 | 5 | 1. [DONE] MSBO and related entities: 6 | The MSBO object is buggy; although models are largely preserved and rendered as 7 | expected, some features are damaged and in FreeCAD they can be seen as points 8 | scattered in space. The logic must be checked to ensure a faithful copy of the 9 | data. 10 | 11 | Sep 29 2016: 12 | 13 | Items to check: 14 | 15 | 1. [DONE] FormatDEInt: what does the specification say about integers in the Directory Entry 16 | section? If a positive integer may have 8 characters, is any extra code needed to 17 | guard the formatting of the DE Line number? 18 | 19 | NOTE: no explicit limit is set, but since Section Line Numbers are only 7 characters 20 | we are limited to a maximum of 9 999 999 PE lines. Since the fields are only 8 21 | characters, the implicit limits for all other values are -9 999 999 to +99 999 999. 22 | The range of the negative values is consistent with a negative value being used to 23 | represent a DE or PE line number. 24 | 25 | DE formatter (iges_entity.cpp) already guards against Line Numbers with more than 26 | 7 digits. AddPDItem() in iges_io.cpp was updated to guard against line number 27 | overflows. 28 | 29 | 30 | 31 | 2. Numeric formatting in the Parameter Section: the specification states that the 32 | end of parameter or end of record must appear on the same line as a number; this 33 | may require blank padding of some PE lines and possibly some modification of the 34 | numeric formatters to ensure that numbers end before Column 71 (end marker goes in C71). 35 | Check: 36 | a. [OK] the numeric output formatters 37 | b. [OK] the parser (must skip blank padding) 38 | 39 | 3. Extending support for other Entity Types: 40 | Use model 10029449-001LF.igs as input to provide support for Entity Type 406. 41 | -------------------------------------------------------------------------------- /CMakeModules/FindSISL.cmake: -------------------------------------------------------------------------------- 1 | find_path( SISL_INCLUDE_DIR sisl.h PATH_SUFFIXES include ) 2 | 3 | if( NOT SISL_LIBRARIES ) 4 | find_library( SISL_LIBRARY_RELEASE NAMES sisl PATH_SUFFIXES lib ) 5 | find_library( SISL_LIBRARY_DEBUG NAMES sisld PATH_SUFFIXES lib ) 6 | 7 | include( SelectLibraryConfigurations ) 8 | SELECT_LIBRARY_CONFIGURATIONS( SISL ) 9 | endif() 10 | 11 | # handle the QUIETLY and REQUIRED arguments and set SISL_FOUND to TRUE if 12 | # all listed variables are TRUE 13 | include( FindPackageHandleStandardArgs ) 14 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( SISL 15 | REQUIRED_VARS SISL_LIBRARIES SISL_INCLUDE_DIR ) 16 | 17 | mark_as_advanced( SISL_INCLUDE_DIR ) 18 | -------------------------------------------------------------------------------- /NOTES.cutouts: -------------------------------------------------------------------------------- 1 | Notes on implementing the PCB noundary and cutouts: 2 | --------------------------------------------------- 3 | 4 | I. Step 1 processing: 5 | KiCad arcs, lines, and circles must be converted 6 | to sets of bounds: 7 | a. main boundary 8 | b. drill holes and other circular cutouts 9 | c. internal cutouts 10 | 11 | II. Step 2 processing: 12 | a. Circular holes must be checked against the main 13 | outline and the main outline's segments adjusted 14 | accordingly. 15 | + there may be only 0 or 2 intersections with 16 | the main boundary; 1 intersection means the 17 | hole is tangent to an edge and this is 18 | forbidden since it is a serious mechanical 19 | defect. More than 2 intersections is forbidden 20 | since that would split the main outline into 21 | multiple bodies. 22 | 23 | There is an exception to this rule when the 24 | intersection happens to be the terminal point 25 | of a segment; in this instance we need to 26 | store a pointer to both entities (CW entity 27 | first) and (to avoid duplicate calcs in the 28 | future) mark whether the intersection is a 29 | terminal point or not. 30 | 31 | + Take any of the arcs formed by the split at 32 | the 2 intersections and determine if it is 33 | inside or outside the main outline. If it is 34 | outside then take the CW terminus and split 35 | the intersecting entities as necessary, 36 | otherwise take the CCW terminus and split 37 | the intersecting entitites. Finally, eliminate 38 | all intermediate segments in the outline in a 39 | CCW direction. Remember to correctly handle 40 | the cases where the ends of the segment list 41 | are involved. 42 | 43 | b. Circular holes must be checked against each cutout 44 | and the cutout adjusted accordingly. 45 | + [TBD] the scheme is similar to that of the 46 | main outline but we are performing a boolean 47 | addition rather than a subtraction 48 | + ??? 49 | 50 | III. Step 3 processing: 51 | Remaining circular holes must be checked against 52 | eachother and overlapping holes merged; to avoid 53 | multiple calculations, create lists with all holes 54 | which overlap. In a pathological case for example 55 | a user may employ multiple holes to represent a slot 56 | and these holes must be amalgamated to produce a 57 | strange undulating slot. Since we cannot guess at 58 | the user's intention, such multiple drills will 59 | remain as multiple overlapping drills; they will not 60 | be interpreted as a slot. 61 | 62 | IV. Step 4 processing: 63 | Cutouts must be checked against eachother and 64 | merged. 65 | 66 | a. [TBD] this requires a bit more thought than the 67 | case of circles being removed since in many cases 68 | we will be dealing with multiple segments. 69 | 70 | V. Step 5 processing: 71 | Cutouts (except for merged circular holes) must be 72 | checked against the main outline and the outline 73 | adjusted accordingly. 74 | 75 | a. [TBD] The processing shall be similar to that 76 | of Step 4 but we are performing a boolean subtraction 77 | rather than an addition. 78 | -------------------------------------------------------------------------------- /patches/0001-sisl.patch: -------------------------------------------------------------------------------- 1 | From 72607f7e7fd0ad634e9b5c30689d1ad51f8cedc7 Mon Sep 17 00:00:00 2001 2 | From: cbernardo 3 | Date: Thu, 11 Jun 2015 14:07:03 +1000 4 | Subject: [PATCH] Patching sisl to work with MinGW 5 | 6 | --- 7 | CMakeLists.txt | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/CMakeLists.txt b/CMakeLists.txt 11 | index 47643a0..1c27394 100644 12 | --- a/CMakeLists.txt 13 | +++ b/CMakeLists.txt 14 | @@ -32,10 +32,10 @@ IF(CMAKE_COMPILER_IS_GNUXX) 15 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-but-set-variable -fPIC") 16 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable -fPIC") 17 | ENDIF(CMAKE_COMPILER_IS_GNUXX) 18 | -IF(WIN32) 19 | +IF(MSVC) 20 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP8 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") 21 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP8 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") 22 | -ENDIF(WIN32) 23 | +ENDIF(MSVC) 24 | 25 | 26 | # Apps, examples, tests, ...? 27 | -- 28 | 1.9.4.msysgit.2 29 | 30 | -------------------------------------------------------------------------------- /recipe/bld.bat: -------------------------------------------------------------------------------- 1 | mkdir build-conda 2 | cd build-conda 3 | 4 | cmake .. ^ 5 | -D CMAKE_BUILD_TYPE:STRING="Release" ^ 6 | -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ 7 | -D CONDA_BUILD:BOOL=TRUE ^ 8 | -G "Ninja" ^ 9 | -Wno-dev 10 | 11 | ninja install 12 | 13 | cd .. 14 | -------------------------------------------------------------------------------- /recipe/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | name: libiges 3 | version: 1.0 4 | 5 | source: 6 | git_url: https://github.com/cbernardo/libIGES.git 7 | # path: ../ 8 | build: 9 | requirements: 10 | build: 11 | - {{ compiler('cxx') }} 12 | - ninja 13 | - cmake 14 | host: 15 | 16 | run: 17 | 18 | about: 19 | license: LGPL2.1 20 | 21 | -------------------------------------------------------------------------------- /samples/idftest/NOTES.idf: -------------------------------------------------------------------------------- 1 | IDF files used to check IDF->IGES conversion 2 | ============================================ 3 | 4 | arduino-due.emn : The original Arduino Due design files represents 5 | slots as multiple overlapping drill holes; the geometry code 6 | in mcad_outline and iges_pcb_geom must handle overlapping holes 7 | correctly. 8 | 9 | crescent.emn : The board shape is a crescent. This file helps verify 10 | that the geometry code handles the shape correctly. 11 | 12 | pic_programmer.emn : Pic Programmer demo project from KiCad; 13 | includes component outlines to check that idf2igs correctly 14 | renders the component extrusions. 15 | 16 | video.emn : Video board demo project from KiCad; includes 17 | component outlines. 18 | 19 | test_strange.emn : Board with a strange cutout and overlapping 20 | drill holes. 21 | 22 | test_out0.emn : Board with overlapping slotted holes; one hole 23 | is vertical and the other placed so that one curved end is 24 | intersected at one point by the vertical edge of the other 25 | slot. This file was created to help track down a bug in the 26 | geometry code. 27 | 28 | test_out1.emn : Same as test_out0 but with the slots defined 29 | in a different order. The order is essential since a 30 | geometry bug may depend on the order of the cutouts. 31 | 32 | test_out2.emn : Similar to test_out0 but with one arc 33 | intersecting an arc on the other slot at one point. 34 | This is to check the arc-arc geometry code as opposed 35 | to the arc-line geometry code tested in test_out0.emn. 36 | 37 | test_out3.emn : Same as test_out2.emn but with the order of 38 | the slots changed. 39 | 40 | test_outline.emn : Same as test_out2.emn but with an 41 | additional non-overlapping slot and drill hole. 42 | 43 | cylinder.emn : Creates a 3mm thick circular PCB with a 44 | trimmed cylindrical component. The file exposed a 45 | deficiency in multiple MCAD systems where multiple 46 | trimmed surfaces may not refer to the same underlying 47 | surface or else the successive surfaces are incorrectly 48 | trimmed. Action: libIGES must create redundant underlying 49 | surfaces as necessary to ensure better interoperability 50 | with problematic MCADs. 51 | -------------------------------------------------------------------------------- /samples/idftest/arduino-due.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/14.17:9:18 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/crescent.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/25.16:58:30 1 3 | "crescent.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | .BOARD_OUTLINE UNOWNED 7 | 1.60000 8 | 0 31.06249 19.10464 0 9 | 0 31.06251 -19.10460 291.63 10 | 0 31.06249 19.10464 -260.33 11 | .END_BOARD_OUTLINE 12 | 13 | .DRILLED_HOLES 14 | .END_DRILLED_HOLES 15 | 16 | -------------------------------------------------------------------------------- /samples/idftest/crescent.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/25.16:58:30 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/cylinder.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/25.16:58:30 1 3 | "no_file" MM 4 | .END_HEADER 5 | 6 | # NOTES: 7 | # There appears to be a problem with the cylindrical NURBS bounds which 8 | # is rather perplexing as to when it manifests. A circular PCB renders 9 | # fine but a circular IDF extrusion does not (the second and third 10 | # curved surfaces are incorrectly trimmed to 1mm height). It is unclear 11 | # as to where the code paths differ. 12 | 13 | # Update #1: The problem also affects the PCB but it is not evident until 14 | # the PCB thickness > 2.0. 15 | # 16 | # Update #2: The problem appears due to an inconsistency in MCADs 17 | # processing trimmed surfaces. In an ideal world the same surface can be 18 | # used multiple times; SolidWorks appears to handle that case correctly 19 | # but many MCAD systems do not, and yet the MCADs which have been tested 20 | # that do not trim correctly appear to perform a correct trim when only 21 | # geometric bounds are used. This can be verified by altering the order 22 | # of the trimmed surfaces; the first one rendered will always be correct 23 | # while the others will be trimmed to a height of 1mm. 24 | # 25 | # Update #3: When SolidWorks creates similar features, the underlying 26 | # surface is not reused (redundant surfaces are created). These models 27 | # are correctly processed on all the MCAD systems tried. 28 | 29 | .BOARD_OUTLINE UNOWNED 30 | 3.0 31 | 0 0 0 0 32 | 0 5 0 360 33 | .END_BOARD_OUTLINE 34 | 35 | .DRILLED_HOLES 36 | .END_DRILLED_HOLES 37 | 38 | .PLACEMENT 39 | "TEST_CYL" "NOGEOM" C1 40 | 0 0 0 0 TOP ECAD 41 | .END_PLACEMENT 42 | -------------------------------------------------------------------------------- /samples/idftest/cylinder.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/25.16:58:30 1 3 | .END_HEADER 4 | 5 | .ELECTRICAL 6 | "TEST_CYL" "NOGEOM" MM 10 7 | 0 -2.5 2.5 0 8 | 0 2.5 2.5 270 9 | 0 -2.5 2.5 0 10 | .END_ELECTRICAL 11 | -------------------------------------------------------------------------------- /samples/idftest/overlap.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "hand edited file" 2015/10/11.16:58:30 1 3 | "overlap_test" MM 4 | .END_HEADER 5 | 6 | # 7 | # This file was created as a test for a regression in which 8 | # overlapping drill holes were not correctly handled and 9 | # bad geometry was produced. 10 | # 11 | 12 | .BOARD_OUTLINE UNOWNED 13 | 1.60000 14 | 0 -10 -10 0 15 | 0 10 -10 0 16 | 0 10 10 0 17 | 0 -10 10 0 18 | 0 -10 -10 0 19 | .END_BOARD_OUTLINE 20 | 21 | 22 | .DRILLED_HOLES 23 | 1.8 -0.8 -4 NPTH "@HOLE6" MTG ECAD 24 | 1.8 0 -4 NPTH "@HOLE7" MTG ECAD 25 | 1.8 0.8 -4 NPTH "@HOLE8" MTG ECAD 26 | 1.8 -3 0.8 NPTH "@HOLE0" MTG ECAD 27 | 1.8 -3 0.0 NPTH "@HOLE1" MTG ECAD 28 | 1.8 -3 -0.8 NPTH "@HOLE2" MTG ECAD 29 | 1.8 -0.8 4 NPTH "@HOLE6" MTG ECAD 30 | 1.8 0 4 NPTH "@HOLE7" MTG ECAD 31 | 1.8 0.8 4 NPTH "@HOLE8" MTG ECAD 32 | 1.8 2.9 0.0 NPTH "@HOLE3" MTG ECAD 33 | 1.8 3 0.8 NPTH "@HOLE4" MTG ECAD 34 | 1.8 3 -0.8 NPTH "@HOLE5" MTG ECAD 35 | 1.8 -0.8 8 NPTH "@HOLE6" MTG ECAD 36 | 1.8 0 8 NPTH "@HOLE7" MTG ECAD 37 | 1.8 0.8 8 NPTH "@HOLE8" MTG ECAD 38 | 1.8 -0.8 -8 NPTH "@HOLE6" MTG ECAD 39 | 1.8 0 -8 NPTH "@HOLE7" MTG ECAD 40 | 1.8 0.8 -8 NPTH "@HOLE8" MTG ECAD 41 | .END_DRILLED_HOLES 42 | -------------------------------------------------------------------------------- /samples/idftest/overlap.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "hand edited file" 2015/10/11.16:58:30 1 3 | .END_HEADER 4 | -------------------------------------------------------------------------------- /samples/idftest/test_other_outline.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by some software" 2014/02/01.15:09:15 1 3 | "test_other_outline" MM 4 | .END_HEADER 5 | 6 | # This file is intended to verify the behavior when handling 7 | # an OTHER_OUTLINE section. When the object is placed on the 8 | # bottom of the board its vertices should not be mirrored; 9 | # in contrast the vertices of a component placed on the bottom 10 | # are mirrored. 11 | 12 | # The board outline is a simple square with a small hole in it 13 | .BOARD_OUTLINE ECAD 14 | 1.60000 15 | 0 -100 100 0 16 | 0 -100 -100 0 17 | 0 100 -100 0 18 | 0 100 100 0 19 | 0 -100 100 0 20 | 1 0 0 0 21 | 1 5 0 360 22 | .END_BOARD_OUTLINE 23 | 24 | # This OTHER OUTLINE is a triangle 25 | .OTHER_OUTLINE UNOWNED 26 | MY_TRI1 30 TOP 27 | 0 -75 75 0 28 | 0 -75 -75 0 29 | 0 75 0 0 30 | 0 -75 75 0 31 | 1 0 0 0 32 | 1 30 0 360 33 | .END_OTHER_OUTLINE 34 | 35 | # This OTHER OUTLINE is on the bottom 36 | .OTHER_OUTLINE UNOWNED 37 | MY_TRI2 2 BOTTOM 38 | 0 75 75 0 39 | 0 75 -75 0 40 | 0 225 0 0 41 | 0 75 75 0 42 | 1 150 0 0 43 | 1 180 0 360 44 | .END_OTHER_OUTLINE 45 | -------------------------------------------------------------------------------- /samples/idftest/test_other_outline.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by some software" 2014/02/01.15:09:15 1 3 | .END_HEADER 4 | 5 | # This file contains no component outlines -------------------------------------------------------------------------------- /samples/idftest/test_out0.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | "junk.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | # NOTE: the overlapping outlines here cause 7 | # a failure in the outline code of libIGES. 8 | # 9 | # The problem happens when an arc intersects 10 | # a non-tangent line at a single point. 11 | # 12 | # Updates: 13 | # 1. There was a problem with incorrect transfer 14 | # of the intersecting point's data (bad indices). 15 | # This has been fixed and the model now displays 16 | # correctly in FreeCAD. 17 | # 18 | # 2. The model still does not display correctly in 19 | # SolidWorks although test_out1.emn displays. 20 | # This indicates some sort of asymmetric bug 21 | # (different code paths) which depends on the 22 | # order of the outline. 23 | 24 | .BOARD_OUTLINE UNOWNED 25 | 1.60000 26 | 0 34.50000 22.50000 0 27 | 0 -34.50000 22.50000 0 28 | 0 -34.50000 -22.50000 0 29 | 0 34.50000 -22.50000 0 30 | 0 34.50000 22.50000 0 31 | 1 -4.24264 -3.63604 0 32 | 1 6.36396 -14.24264 0 33 | 1 4.24264 -16.36396 -180.000 34 | 1 -6.36396 -5.75736 0 35 | 1 -4.24264 -3.63604 -180.000 36 | 2 -5.00000 3.00000 0 37 | 2 -5.00000 -12.00000 0 38 | 2 -8.00000 -12.00000 -180.000 39 | 2 -8.00000 3.00000 0 40 | 2 -5.00000 3.00000 -180.000 41 | .END_BOARD_OUTLINE 42 | -------------------------------------------------------------------------------- /samples/idftest/test_out0.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/test_out1.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | "junk.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | # NOTE: the overlapping outlines here cause 7 | # a failure in the outline code of libIGES. 8 | # 9 | # The problem happens when an arc intersects 10 | # a non-tangent line at a single point. 11 | # This test file has the same data as 12 | # test_out1.emn but with the cutout order 13 | # reversed. 14 | # 15 | # Update: the problem was in incorrect transfer 16 | # of the intersecting point's data (bad indices) 17 | # 18 | 19 | .BOARD_OUTLINE UNOWNED 20 | 1.60000 21 | 0 34.50000 22.50000 0 22 | 0 -34.50000 22.50000 0 23 | 0 -34.50000 -22.50000 0 24 | 0 34.50000 -22.50000 0 25 | 0 34.50000 22.50000 0 26 | 1 -5.00000 3.00000 0 27 | 1 -5.00000 -12.00000 0 28 | 1 -8.00000 -12.00000 -180.000 29 | 1 -8.00000 3.00000 0 30 | 1 -5.00000 3.00000 -180.000 31 | 2 -4.24264 -3.63604 0 32 | 2 6.36396 -14.24264 0 33 | 2 4.24264 -16.36396 -180.000 34 | 2 -6.36396 -5.75736 0 35 | 2 -4.24264 -3.63604 -180.000 36 | .END_BOARD_OUTLINE 37 | -------------------------------------------------------------------------------- /samples/idftest/test_out1.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/test_out2.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.21:27:49 1 3 | "junk.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | # Note: This file causes a failure in the libIGES 7 | # curve merging routines. The cutouts have walls 8 | # but the surface is not rendered by FreeCAD, which 9 | # indicates a fault. The surface is rendered by 10 | # SolidWorks, which suggests that the problem is 11 | # either in the representation of the Curve on 12 | # Surface boundary or the model-space boundary curve. 13 | # 14 | # Update: the fault is definitely with the model-space 15 | # boundary curve and is due to not having a start angle 16 | # -M_PI < A <= M_PI 17 | # 18 | 19 | .BOARD_OUTLINE UNOWNED 20 | 1.60000 21 | 0 34.50000 22.50000 0 22 | 0 -34.50000 22.50000 0 23 | 0 -34.50000 -22.50000 0 24 | 0 34.50000 -22.50000 0 25 | 0 34.50000 22.50000 0 26 | 1 -23.00000 2.50000 0 27 | 1 -23.00000 -12.50000 0 28 | 1 -26.00000 -12.50000 -180.000 29 | 1 -26.00000 2.50000 0 30 | 1 -23.00000 2.50000 -180.000 31 | 2 -24.36396 3.25736 0 32 | 2 -13.75736 13.86396 0 33 | 2 -11.63604 11.74264 -180.000 34 | 2 -22.24264 1.13604 0 35 | 2 -24.36396 3.25736 -180.000 36 | .END_BOARD_OUTLINE 37 | 38 | -------------------------------------------------------------------------------- /samples/idftest/test_out2.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.21:27:49 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/test_out3.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.21:27:49 1 3 | "junk.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | # Note: This file causes a failure in the libIGES 7 | # curve merging routines. The cutouts have walls 8 | # but the surface is not rendered by FreeCAD, which 9 | # indicates a fault. The surface is rendered by 10 | # SolidWorks, which suggests that the problem is 11 | # either in the representation of the Curve on 12 | # Surface boundary or the model-space boundary curve. 13 | # 14 | # The data is the same as in test_out2.emn but with 15 | # the cutout order exchanged. 16 | # 17 | # Update: the fault is definitely with the model-space 18 | # boundary curve and is due to not having a start angle 19 | # -M_PI < A <= M_PI 20 | # 21 | 22 | .BOARD_OUTLINE UNOWNED 23 | 1.60000 24 | 0 34.50000 22.50000 0 25 | 0 -34.50000 22.50000 0 26 | 0 -34.50000 -22.50000 0 27 | 0 34.50000 -22.50000 0 28 | 0 34.50000 22.50000 0 29 | 1 -24.36396 3.25736 0 30 | 1 -13.75736 13.86396 0 31 | 1 -11.63604 11.74264 -180.000 32 | 1 -22.24264 1.13604 0 33 | 1 -24.36396 3.25736 -180.000 34 | 2 -23.00000 2.50000 0 35 | 2 -23.00000 -12.50000 0 36 | 2 -26.00000 -12.50000 -180.000 37 | 2 -26.00000 2.50000 0 38 | 2 -23.00000 2.50000 -180.000 39 | .END_BOARD_OUTLINE 40 | 41 | -------------------------------------------------------------------------------- /samples/idftest/test_out3.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/test_outline.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | "junk.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | # NOTE: the overlapping outlines here cause 7 | # a failure in the outline code of libIGES. 8 | # In the part which is commented out the error 9 | # appears to be a mismatch between radii; 10 | # in the active part (loop order is 3, 1, 2) 11 | # the error states Point 0 is not on a line. 12 | # Loop 2 is extraneous and is not part of the 13 | # problem. 14 | # 15 | # The problem happens when an arc intersects 16 | # a non-tangent line at a single point. 17 | 18 | #1 -4.24264 -3.63604 0 19 | #1 6.36396 -14.24264 0 20 | #1 4.24264 -16.36396 -180.000 21 | #1 -6.36396 -5.75736 0 22 | #1 -4.24264 -3.63604 -180.000 23 | #2 27.86396 2.74264 0 24 | #2 17.25736 -7.86396 0 25 | #2 15.13604 -5.74264 -180.000 26 | #2 25.74264 4.86396 0 27 | #2 27.86396 2.74264 -180.000 28 | #3 -5.00000 3.00000 0 29 | #3 -5.00000 -12.00000 0 30 | #3 -8.00000 -12.00000 -180.000 31 | #3 -8.00000 3.00000 0 32 | #3 -5.00000 3.00000 -180.000 33 | 34 | .BOARD_OUTLINE UNOWNED 35 | 1.60000 36 | 0 34.50000 22.50000 0 37 | 0 -34.50000 22.50000 0 38 | 0 -34.50000 -22.50000 0 39 | 0 34.50000 -22.50000 0 40 | 0 34.50000 22.50000 0 41 | 1 -5.00000 3.00000 0 42 | 1 -5.00000 -12.00000 0 43 | 1 -8.00000 -12.00000 -180.000 44 | 1 -8.00000 3.00000 0 45 | 1 -5.00000 3.00000 -180.000 46 | 2 -4.24264 -3.63604 0 47 | 2 6.36396 -14.24264 0 48 | 2 4.24264 -16.36396 -180.000 49 | 2 -6.36396 -5.75736 0 50 | 2 -4.24264 -3.63604 -180.000 51 | 3 27.86396 2.74264 0 52 | 3 17.25736 -7.86396 0 53 | 3 15.13604 -5.74264 -180.000 54 | 3 25.74264 4.86396 0 55 | 3 27.86396 2.74264 -180.000 56 | .END_BOARD_OUTLINE 57 | 58 | .DRILLED_HOLES 59 | 2.500 -26.50000 14.50000 PTH "MH" PIN ECAD 60 | .END_DRILLED_HOLES 61 | -------------------------------------------------------------------------------- /samples/idftest/test_outline.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-06-26 BZR 5832)-product" 2015/06/4.20:42:21 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /samples/idftest/test_strange.emn: -------------------------------------------------------------------------------- 1 | .HEADER 2 | BOARD_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/27.15:15:49 1 3 | "test_strange.kicad_pcb" MM 4 | .END_HEADER 5 | 6 | .BOARD_OUTLINE UNOWNED 7 | 1.60000 8 | 0 -15.00000 -9.00000 0 9 | 0 -13.00000 -11.00000 90.00 10 | 0 13.00000 -11.00000 0 11 | 0 15.00000 -9.00000 -90.00 12 | 0 15.00000 9.00000 0 13 | 0 13.00000 11.00000 90.00 14 | 0 -13.00000 11.00000 0 15 | 0 -15.00000 9.00000 90.00 16 | 0 -15.00000 -9.00000 0 17 | 1 -1.00000 -3.00000 0 18 | 1 -4.00000 -3.00000 360 19 | 2 -1.00000 9.00000 0 20 | 2 6.50000 9.00000 0 21 | 2 6.50000 4.50000 0 22 | 2 0.00000 4.50000 0 23 | 2 -1.00000 3.50000 90.00 24 | 2 -1.00000 9.00000 0 25 | .END_BOARD_OUTLINE 26 | 27 | #0.8 -15 0 PTH "C1" PIN ECAD 28 | #0.8 -14.7 0 PTH "C2" PIN ECAD 29 | #0.8 -14.4 0 PTH "C3" PIN ECAD 30 | 31 | .DRILLED_HOLES 32 | 0.8 -15 0 PTH "C1" PIN ECAD 33 | 0.8 -12 0 PTH "C1" PIN ECAD 34 | 0.8 -11.8 0 PTH "C1" PIN ECAD 35 | .END_DRILLED_HOLES 36 | 37 | -------------------------------------------------------------------------------- /samples/idftest/test_strange.emp: -------------------------------------------------------------------------------- 1 | .HEADER 2 | LIBRARY_FILE 3.0 "Created by KiCad (2015-04-08 BZR 5585)-product" 2015/04/27.15:15:49 1 3 | .END_HEADER 4 | 5 | -------------------------------------------------------------------------------- /sisl_exports.def: -------------------------------------------------------------------------------- 1 | LIBRARY sisl 2 | EXPORTS 3 | newbox @1 4 | newCurve @2 5 | copyCurve @3 6 | newdir @4 7 | newIntcurve @5 8 | newSurf @6 9 | copySurface @7 10 | freeCurve @8 11 | freeIntcrvlist @9 12 | freeIntcurve @10 13 | freeSurf @11 14 | s1001 @12 15 | s1011 @13 16 | s1012 @14 17 | s1013 @15 18 | s1014 @16 19 | s1015 @17 20 | s1016 @18 21 | s1017 @19 22 | s1018 @20 23 | s1021 @21 24 | s1022 @22 25 | s1023 @23 26 | s1024 @24 27 | s1025 @25 28 | s1221 @26 29 | s1225 @27 30 | s1226 @28 31 | s1227 @29 32 | s1233 @30 33 | s1237 @31 34 | s1238 @32 35 | s1240 @33 36 | s1241 @34 37 | s1243 @35 38 | s1302 @36 39 | s1303 @37 40 | s1310 @38 41 | s1314 @39 42 | s1315 @40 43 | s1316 @41 44 | s1317 @42 45 | s1318 @43 46 | s1319 @44 47 | s1327 @45 48 | s1328 @46 49 | s1332 @47 50 | s1356 @48 51 | s1357 @49 52 | s1360 @50 53 | s1363 @51 54 | s1364 @52 55 | s1365 @53 56 | s1369 @54 57 | s1371 @55 58 | s1372 @56 59 | s1373 @57 60 | s1374 @58 61 | s1375 @59 62 | s1379 @60 63 | s1380 @61 64 | s1383 @62 65 | s1386 @63 66 | s1387 @64 67 | s1388 @65 68 | s1389 @66 69 | s1390 @67 70 | s1391 @68 71 | s1401 @69 72 | s1421 @70 73 | s1422 @71 74 | s1424 @72 75 | s1425 @73 76 | s1439 @74 77 | s1440 @75 78 | s1450 @76 79 | s1451 @77 80 | s1501 @78 81 | s1502 @79 82 | s1503 @80 83 | s1506 @81 84 | s1508 @82 85 | s1510 @83 86 | s1511 @84 87 | s1514 @85 88 | s1515 @86 89 | s1518 @87 90 | s1522 @88 91 | s1529 @89 92 | s1530 @90 93 | s1534 @91 94 | s1535 @92 95 | s1536 @93 96 | s1537 @94 97 | s1538 @95 98 | s1539 @96 99 | s1542 @97 100 | s1600 @98 101 | s1601 @99 102 | s1602 @100 103 | s1603 @101 104 | s1606 @102 105 | s1607 @103 106 | s1608 @104 107 | s1609 @105 108 | s1611 @106 109 | s1613 @107 110 | s1620 @108 111 | s1630 @109 112 | s1706 @110 113 | s1710 @111 114 | s1711 @112 115 | s1712 @113 116 | s1713 @114 117 | s1714 @115 118 | s1715 @116 119 | s1716 @117 120 | s1720 @118 121 | s1730 @119 122 | s1731 @120 123 | s1732 @121 124 | s1733 @122 125 | s1750 @123 126 | s1774 @124 127 | s1775 @125 128 | s1850 @126 129 | s1851 @127 130 | s1852 @128 131 | s1853 @129 132 | s1854 @130 133 | s1855 @131 134 | s1856 @132 135 | s1857 @133 136 | s1858 @134 137 | s1859 @135 138 | s1860 @136 139 | s1920 @137 140 | s1921 @138 141 | s1940 @139 142 | s1953 @140 143 | s1954 @141 144 | s1955 @142 145 | s1957 @143 146 | s1958 @144 147 | s1961 @145 148 | s1962 @146 149 | s1963 @147 150 | s1965 @148 151 | s1966 @149 152 | s1967 @150 153 | s1968 @151 154 | s1986 @152 155 | s1987 @153 156 | s1988 @154 157 | s1989 @155 158 | s2500 @156 159 | s2502 @157 160 | s2504 @158 161 | s2506 @159 162 | s2508 @160 163 | s2510 @161 164 | s2532 @162 165 | s2536 @163 166 | s2540 @164 167 | s2542 @165 168 | s2544 @166 169 | s2545 @167 170 | s2550 @168 171 | s2553 @169 172 | s2556 @170 173 | s2559 @171 174 | s2562 @172 175 | s6drawseq @173 176 | -------------------------------------------------------------------------------- /src/dllapi/README: -------------------------------------------------------------------------------- 1 | This directory contains the DLL API layer which is necessary 2 | to support builds using MSVC. For best portability results 3 | all code must use this layer rather than directly using the 4 | various lower level IGES modules. 5 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity102.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity102.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | DLL_IGES_ENTITY_102::DLL_IGES_ENTITY_102( IGES* aParent, bool create ) : DLL_IGES_CURVE( aParent ) 33 | { 34 | m_type = ENT_COMPOSITE_CURVE; 35 | 36 | if( create ) 37 | { 38 | if( NULL != aParent ) 39 | aParent->NewEntity( ENT_COMPOSITE_CURVE, &m_entity ); 40 | else 41 | m_entity = new IGES_ENTITY_102( NULL ); 42 | 43 | if( NULL != m_entity ) 44 | m_entity->AttachValidFlag( &m_valid ); 45 | } 46 | 47 | return; 48 | } 49 | 50 | 51 | DLL_IGES_ENTITY_102::DLL_IGES_ENTITY_102( DLL_IGES& aParent, bool create ) : DLL_IGES_CURVE( aParent ) 52 | { 53 | m_type = ENT_COMPOSITE_CURVE; 54 | IGES* ip = aParent.GetRawPtr(); 55 | 56 | if( !create || NULL == ip ) 57 | return; 58 | 59 | ip->NewEntity( ENT_COMPOSITE_CURVE, &m_entity ); 60 | 61 | if( NULL != m_entity ) 62 | m_entity->AttachValidFlag( &m_valid ); 63 | 64 | return; 65 | } 66 | 67 | 68 | DLL_IGES_ENTITY_102::~DLL_IGES_ENTITY_102() 69 | { 70 | return; 71 | } 72 | 73 | 74 | bool DLL_IGES_ENTITY_102::NewEntity( void ) 75 | { 76 | if( m_valid && NULL != m_entity ) 77 | { 78 | m_entity->DetachValidFlag( &m_valid ); 79 | m_entity = NULL; 80 | } 81 | 82 | if( NULL != m_parent && m_hasParent ) 83 | m_parent->NewEntity( ENT_COMPOSITE_CURVE, &m_entity ); 84 | else 85 | m_entity = new IGES_ENTITY_102( NULL ); 86 | 87 | if( NULL != m_entity ) 88 | { 89 | m_entity->AttachValidFlag( &m_valid ); 90 | return true; 91 | } 92 | 93 | return false; 94 | } 95 | 96 | 97 | bool DLL_IGES_ENTITY_102::AddSegment( IGES_CURVE* aSegment ) 98 | { 99 | if( !m_valid || NULL == m_entity ) 100 | return false; 101 | 102 | return ((IGES_ENTITY_102*)m_entity)->AddSegment( aSegment ); 103 | } 104 | 105 | 106 | bool DLL_IGES_ENTITY_102::AddSegment( DLL_IGES_CURVE& aSegment ) 107 | { 108 | if( !m_valid || NULL == m_entity ) 109 | return false; 110 | 111 | return ((IGES_ENTITY_102*)m_entity)->AddSegment( (IGES_CURVE*) aSegment.GetRawPtr() ); 112 | } 113 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity120.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity120.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | 33 | DLL_IGES_ENTITY_120::DLL_IGES_ENTITY_120( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 34 | { 35 | m_type = ENT_SURFACE_OF_REVOLUTION; 36 | 37 | if( create ) 38 | { 39 | if( NULL != aParent ) 40 | aParent->NewEntity( ENT_SURFACE_OF_REVOLUTION, &m_entity ); 41 | else 42 | m_entity = new IGES_ENTITY_120( NULL ); 43 | 44 | if( NULL != m_entity ) 45 | m_entity->AttachValidFlag( &m_valid ); 46 | } 47 | 48 | return; 49 | } 50 | 51 | 52 | DLL_IGES_ENTITY_120::DLL_IGES_ENTITY_120( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 53 | { 54 | m_type = ENT_SURFACE_OF_REVOLUTION; 55 | IGES* ip = aParent.GetRawPtr(); 56 | 57 | if( !create || NULL == ip ) 58 | return; 59 | 60 | ip->NewEntity( ENT_SURFACE_OF_REVOLUTION, &m_entity ); 61 | 62 | if( NULL != m_entity ) 63 | m_entity->AttachValidFlag( &m_valid ); 64 | 65 | return; 66 | } 67 | 68 | 69 | DLL_IGES_ENTITY_120::~DLL_IGES_ENTITY_120() 70 | { 71 | return; 72 | } 73 | 74 | 75 | bool DLL_IGES_ENTITY_120::NewEntity( void ) 76 | { 77 | if( m_valid && NULL != m_entity ) 78 | { 79 | m_entity->DetachValidFlag( &m_valid ); 80 | m_entity = NULL; 81 | } 82 | 83 | if( NULL != m_parent && m_hasParent ) 84 | m_parent->NewEntity( ENT_SURFACE_OF_REVOLUTION, &m_entity ); 85 | else 86 | m_entity = new IGES_ENTITY_120( NULL ); 87 | 88 | if( NULL != m_entity ) 89 | { 90 | m_entity->AttachValidFlag(&m_valid); 91 | return true; 92 | } 93 | 94 | return false; 95 | } 96 | 97 | 98 | bool DLL_IGES_ENTITY_120::GetAxis( IGES_CURVE** aCurve ) 99 | { 100 | if( !m_valid || NULL == m_entity ) 101 | return false; 102 | 103 | return ((IGES_ENTITY_120*)m_entity)->GetAxis( aCurve ); 104 | } 105 | 106 | 107 | bool DLL_IGES_ENTITY_120::SetAxis( IGES_CURVE* aCurve ) 108 | { 109 | if( !m_valid || NULL == m_entity ) 110 | return false; 111 | 112 | return ((IGES_ENTITY_120*)m_entity)->SetAxis( aCurve ); 113 | } 114 | 115 | 116 | bool DLL_IGES_ENTITY_120::SetAxis( DLL_IGES_CURVE& aCurve ) 117 | { 118 | if( !m_valid || NULL == m_entity ) 119 | return false; 120 | 121 | return ((IGES_ENTITY_120*)m_entity)->SetAxis( (IGES_CURVE*) aCurve.GetRawPtr() ); 122 | } 123 | 124 | 125 | bool DLL_IGES_ENTITY_120::GetGeneratrix( IGES_CURVE** aCurve ) 126 | { 127 | if( !m_valid || NULL == m_entity ) 128 | return false; 129 | 130 | return ((IGES_ENTITY_120*)m_entity)->GetGeneratrix( aCurve ); 131 | } 132 | 133 | 134 | bool DLL_IGES_ENTITY_120::SetGeneratrix( IGES_CURVE* aCurve ) 135 | { 136 | if( !m_valid || NULL == m_entity ) 137 | return false; 138 | 139 | return ((IGES_ENTITY_120*)m_entity)->SetGeneratrix( aCurve ); 140 | } 141 | 142 | 143 | bool DLL_IGES_ENTITY_120::SetGeneratrix( DLL_IGES_CURVE& aCurve ) 144 | { 145 | if( !m_valid || NULL == m_entity ) 146 | return false; 147 | 148 | return ((IGES_ENTITY_120*)m_entity)->SetGeneratrix( (IGES_CURVE*) aCurve.GetRawPtr() ); 149 | } 150 | 151 | 152 | bool DLL_IGES_ENTITY_120::GetAngles( double& aStartAngle, double& aEndAngle ) 153 | { 154 | if( !m_valid || NULL == m_entity ) 155 | return false; 156 | 157 | aStartAngle = ((IGES_ENTITY_120*)m_entity)->startAngle; 158 | aEndAngle = ((IGES_ENTITY_120*)m_entity)->endAngle; 159 | return true; 160 | } 161 | 162 | 163 | bool DLL_IGES_ENTITY_120::SetAngles( double aStartAngle, double aEndAngle ) 164 | { 165 | if( !m_valid || NULL == m_entity ) 166 | return false; 167 | 168 | ((IGES_ENTITY_120*)m_entity)->startAngle = aStartAngle; 169 | ((IGES_ENTITY_120*)m_entity)->endAngle = aEndAngle; 170 | return true; 171 | } 172 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity122.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity122.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | DLL_IGES_ENTITY_122::DLL_IGES_ENTITY_122( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 31 | { 32 | m_type = ENT_TABULATED_CYLINDER; 33 | 34 | if( create ) 35 | { 36 | if( NULL != aParent ) 37 | aParent->NewEntity( ENT_TABULATED_CYLINDER, &m_entity ); 38 | else 39 | m_entity = new IGES_ENTITY_122( NULL ); 40 | 41 | if( NULL != m_entity ) 42 | m_entity->AttachValidFlag( &m_valid ); 43 | } 44 | 45 | return; 46 | } 47 | 48 | 49 | DLL_IGES_ENTITY_122::DLL_IGES_ENTITY_122( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 50 | { 51 | m_type = ENT_TABULATED_CYLINDER; 52 | IGES* ip = aParent.GetRawPtr(); 53 | 54 | if( !create || NULL == ip ) 55 | return; 56 | 57 | ip->NewEntity( ENT_TABULATED_CYLINDER, &m_entity ); 58 | 59 | if( NULL != m_entity ) 60 | m_entity->AttachValidFlag( &m_valid ); 61 | 62 | return; 63 | } 64 | 65 | 66 | DLL_IGES_ENTITY_122::~DLL_IGES_ENTITY_122() 67 | { 68 | return; 69 | } 70 | 71 | 72 | bool DLL_IGES_ENTITY_122::NewEntity( void ) 73 | { 74 | if( m_valid && NULL != m_entity ) 75 | { 76 | m_entity->DetachValidFlag( &m_valid ); 77 | m_entity = NULL; 78 | } 79 | 80 | if( NULL != m_parent && m_hasParent ) 81 | m_parent->NewEntity( ENT_TABULATED_CYLINDER, &m_entity ); 82 | else 83 | m_entity = new IGES_ENTITY_122( NULL ); 84 | 85 | if( NULL != m_entity ) 86 | { 87 | m_entity->AttachValidFlag(&m_valid); 88 | return true; 89 | } 90 | 91 | return false; 92 | } 93 | 94 | 95 | bool DLL_IGES_ENTITY_122::GetGeneratrixEnd( MCAD_POINT& pt ) 96 | { 97 | if( !m_valid || NULL == m_entity ) 98 | return false; 99 | 100 | pt.x = ((IGES_ENTITY_122*)m_entity)->LX; 101 | pt.y = ((IGES_ENTITY_122*)m_entity)->LY; 102 | pt.z = ((IGES_ENTITY_122*)m_entity)->LZ; 103 | return true; 104 | } 105 | 106 | 107 | bool DLL_IGES_ENTITY_122::GetGeneratrixEnd( double& aX, double& aY, double& aZ ) 108 | { 109 | if( !m_valid || NULL == m_entity ) 110 | return false; 111 | 112 | aX = ((IGES_ENTITY_122*)m_entity)->LX; 113 | aY = ((IGES_ENTITY_122*)m_entity)->LY; 114 | aZ = ((IGES_ENTITY_122*)m_entity)->LZ; 115 | return true; 116 | } 117 | 118 | 119 | bool DLL_IGES_ENTITY_122::GetDirectrix( IGES_CURVE*& aPtr ) 120 | { 121 | if( !m_valid || NULL == m_entity ) 122 | return false; 123 | 124 | return ((IGES_ENTITY_122*)m_entity)->GetDE( aPtr ); 125 | } 126 | 127 | 128 | bool DLL_IGES_ENTITY_122::SetGeneratrixEnd( MCAD_POINT pt ) 129 | { 130 | if( !m_valid || NULL == m_entity ) 131 | return false; 132 | 133 | ((IGES_ENTITY_122*)m_entity)->LX = pt.x; 134 | ((IGES_ENTITY_122*)m_entity)->LX = pt.y; 135 | ((IGES_ENTITY_122*)m_entity)->LX = pt.z; 136 | return true; 137 | } 138 | 139 | 140 | bool DLL_IGES_ENTITY_122::SetGeneratrixEnd( double aX, double aY, double aZ ) 141 | { 142 | if( !m_valid || NULL == m_entity ) 143 | return false; 144 | 145 | ((IGES_ENTITY_122*)m_entity)->LX = aX; 146 | ((IGES_ENTITY_122*)m_entity)->LX = aY; 147 | ((IGES_ENTITY_122*)m_entity)->LX = aZ; 148 | return true; 149 | } 150 | 151 | 152 | bool DLL_IGES_ENTITY_122::SetDirectrix( IGES_CURVE* aPtr ) 153 | { 154 | if( !m_valid || NULL == m_entity ) 155 | return false; 156 | 157 | return ((IGES_ENTITY_122*)m_entity)->SetDE( aPtr ); 158 | } 159 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity124.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity124.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | DLL_IGES_ENTITY_124::DLL_IGES_ENTITY_124( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 32 | { 33 | m_type = ENT_TRANSFORMATION_MATRIX; 34 | 35 | if( create ) 36 | { 37 | if( NULL != aParent ) 38 | aParent->NewEntity( ENT_TRANSFORMATION_MATRIX, &m_entity ); 39 | else 40 | m_entity = new IGES_ENTITY_124( NULL ); 41 | 42 | if( NULL != m_entity ) 43 | m_entity->AttachValidFlag( &m_valid ); 44 | } 45 | 46 | return; 47 | } 48 | 49 | 50 | DLL_IGES_ENTITY_124::DLL_IGES_ENTITY_124( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 51 | { 52 | m_type = ENT_TRANSFORMATION_MATRIX; 53 | IGES* ip = aParent.GetRawPtr(); 54 | 55 | if( !create || NULL == ip ) 56 | return; 57 | 58 | ip->NewEntity( ENT_TRANSFORMATION_MATRIX, &m_entity ); 59 | 60 | if( NULL != m_entity ) 61 | m_entity->AttachValidFlag( &m_valid ); 62 | 63 | return; 64 | } 65 | 66 | 67 | DLL_IGES_ENTITY_124::~DLL_IGES_ENTITY_124() 68 | { 69 | return; 70 | } 71 | 72 | 73 | bool DLL_IGES_ENTITY_124::NewEntity( void ) 74 | { 75 | if( m_valid && NULL != m_entity ) 76 | { 77 | m_entity->DetachValidFlag( &m_valid ); 78 | m_entity = NULL; 79 | } 80 | 81 | if( NULL != m_parent && m_hasParent ) 82 | m_parent->NewEntity( ENT_TRANSFORMATION_MATRIX, &m_entity ); 83 | else 84 | m_entity = new IGES_ENTITY_124( NULL ); 85 | 86 | if( NULL != m_entity ) 87 | { 88 | m_entity->AttachValidFlag(&m_valid); 89 | return true; 90 | } 91 | 92 | return false; 93 | } 94 | 95 | 96 | bool DLL_IGES_ENTITY_124::GetOverallTransform( MCAD_TRANSFORM& aTX ) 97 | { 98 | if( !m_valid || NULL == m_entity ) 99 | return false; 100 | 101 | aTX = ((IGES_ENTITY_124*)m_entity)->GetTransformMatrix(); 102 | return true; 103 | } 104 | 105 | 106 | bool DLL_IGES_ENTITY_124::GetRootTransform( MCAD_TRANSFORM& aTX ) 107 | { 108 | if( !m_valid || NULL == m_entity ) 109 | return false; 110 | 111 | aTX = ((IGES_ENTITY_124*)m_entity)->T; 112 | return true; 113 | } 114 | 115 | 116 | bool DLL_IGES_ENTITY_124::SetRootTransform( MCAD_TRANSFORM* aTX ) 117 | { 118 | if( !m_valid || NULL == m_entity || NULL == aTX ) 119 | return false; 120 | 121 | ((IGES_ENTITY_124*)m_entity)->T = *aTX; 122 | return true; 123 | } 124 | 125 | 126 | bool DLL_IGES_ENTITY_124::SetRootTransform( MCAD_TRANSFORM& aTX ) 127 | { 128 | if( !m_valid || NULL == m_entity ) 129 | return false; 130 | 131 | ((IGES_ENTITY_124*)m_entity)->T = aTX; 132 | return true; 133 | } 134 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity126.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity126.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | DLL_IGES_ENTITY_126::DLL_IGES_ENTITY_126( IGES* aParent, bool create ) : DLL_IGES_CURVE( aParent ) 32 | { 33 | m_type = ENT_NURBS_CURVE; 34 | 35 | if( create ) 36 | { 37 | if( NULL != aParent ) 38 | aParent->NewEntity( ENT_NURBS_CURVE, &m_entity ); 39 | else 40 | m_entity = new IGES_ENTITY_126( NULL ); 41 | 42 | if( NULL != m_entity ) 43 | m_entity->AttachValidFlag( &m_valid ); 44 | } 45 | 46 | return; 47 | } 48 | 49 | 50 | DLL_IGES_ENTITY_126::DLL_IGES_ENTITY_126( DLL_IGES& aParent, bool create ) : DLL_IGES_CURVE( aParent ) 51 | { 52 | m_type = ENT_NURBS_CURVE; 53 | IGES* ip = aParent.GetRawPtr(); 54 | 55 | if( !create || NULL == ip ) 56 | return; 57 | 58 | ip->NewEntity( ENT_NURBS_CURVE, &m_entity ); 59 | 60 | if( NULL != m_entity ) 61 | m_entity->AttachValidFlag( &m_valid ); 62 | 63 | return; 64 | } 65 | 66 | 67 | DLL_IGES_ENTITY_126::~DLL_IGES_ENTITY_126() 68 | { 69 | return; 70 | } 71 | 72 | 73 | bool DLL_IGES_ENTITY_126::NewEntity( void ) 74 | { 75 | if( m_valid && NULL != m_entity ) 76 | { 77 | m_entity->DetachValidFlag( &m_valid ); 78 | m_entity = NULL; 79 | } 80 | 81 | if( NULL != m_parent && m_hasParent ) 82 | m_parent->NewEntity( ENT_NURBS_CURVE, &m_entity ); 83 | else 84 | m_entity = new IGES_ENTITY_126( NULL ); 85 | 86 | if( NULL != m_entity ) 87 | { 88 | m_entity->AttachValidFlag(&m_valid); 89 | return true; 90 | } 91 | 92 | return false; 93 | } 94 | 95 | 96 | bool DLL_IGES_ENTITY_126::GetNURBSData( int& nCoeff, int& order, double** knot, 97 | double** coeff, bool& isRational, bool& isClosed, bool& isPeriodic, 98 | double& v0, double& v1 ) 99 | { 100 | if( !m_valid || NULL == m_entity ) 101 | return false; 102 | 103 | return ((IGES_ENTITY_126*)m_entity)->GetNURBSData( nCoeff, order, knot, 104 | coeff, isRational, isClosed, isPeriodic, v0, v1 ); 105 | } 106 | 107 | 108 | bool DLL_IGES_ENTITY_126::SetNURBSData( int nCoeff, int order, const double* knot, 109 | const double* coeff, bool isRational, double v0, double v1 ) 110 | { 111 | if( !m_valid || NULL == m_entity ) 112 | return false; 113 | 114 | return ((IGES_ENTITY_126*)m_entity)->SetNURBSData( nCoeff, order, knot, 115 | coeff, isRational, v0, v1 ); 116 | } 117 | 118 | 119 | bool DLL_IGES_ENTITY_126::IsPlanar( bool& aResult ) 120 | { 121 | if( !m_valid || NULL == m_entity ) 122 | return false; 123 | 124 | aResult = ((IGES_ENTITY_126*)m_entity)->IsPlanar(); 125 | return true; 126 | } 127 | 128 | 129 | bool DLL_IGES_ENTITY_126::IsRational( bool& aResult ) 130 | { 131 | if( !m_valid || NULL == m_entity ) 132 | return false; 133 | 134 | aResult = ((IGES_ENTITY_126*)m_entity)->IsRational(); 135 | return true; 136 | } 137 | 138 | 139 | bool DLL_IGES_ENTITY_126::isPeriodic( bool& aResult ) 140 | { 141 | if( !m_valid || NULL == m_entity ) 142 | return false; 143 | 144 | aResult = ((IGES_ENTITY_126*)m_entity)->isPeriodic(); 145 | return true; 146 | } 147 | 148 | 149 | bool DLL_IGES_ENTITY_126::GetNormal( MCAD_POINT& aNorm ) 150 | { 151 | if( !m_valid || NULL == m_entity ) 152 | return false; 153 | 154 | return ((IGES_ENTITY_126*)m_entity)->GetNormal( aNorm ); 155 | } 156 | 157 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity128.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity128.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | DLL_IGES_ENTITY_128::DLL_IGES_ENTITY_128( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 33 | { 34 | m_type = ENT_NURBS_SURFACE; 35 | 36 | if( create ) 37 | { 38 | if( NULL != aParent ) 39 | aParent->NewEntity( ENT_NURBS_SURFACE, &m_entity ); 40 | else 41 | m_entity = new IGES_ENTITY_128( NULL ); 42 | 43 | if( NULL != m_entity ) 44 | m_entity->AttachValidFlag( &m_valid ); 45 | } 46 | 47 | return; 48 | } 49 | 50 | 51 | DLL_IGES_ENTITY_128::DLL_IGES_ENTITY_128( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 52 | { 53 | m_type = ENT_NURBS_SURFACE; 54 | IGES* ip = aParent.GetRawPtr(); 55 | 56 | if( !create || NULL == ip ) 57 | return; 58 | 59 | ip->NewEntity( ENT_NURBS_SURFACE, &m_entity ); 60 | 61 | if( NULL != m_entity ) 62 | m_entity->AttachValidFlag( &m_valid ); 63 | 64 | return; 65 | } 66 | 67 | 68 | DLL_IGES_ENTITY_128::~DLL_IGES_ENTITY_128() 69 | { 70 | return; 71 | } 72 | 73 | 74 | bool DLL_IGES_ENTITY_128::NewEntity( void ) 75 | { 76 | if( m_valid && NULL != m_entity ) 77 | { 78 | m_entity->DetachValidFlag( &m_valid ); 79 | m_entity = NULL; 80 | } 81 | 82 | if( NULL != m_parent && m_hasParent ) 83 | m_parent->NewEntity( ENT_NURBS_SURFACE, &m_entity ); 84 | else 85 | m_entity = new IGES_ENTITY_128( NULL ); 86 | 87 | if( NULL != m_entity ) 88 | { 89 | m_entity->AttachValidFlag(&m_valid); 90 | return true; 91 | } 92 | 93 | return false; 94 | } 95 | 96 | 97 | bool DLL_IGES_ENTITY_128::GetNURBSData( int& nCoeff1, int& nCoeff2, 98 | int& order1, int& order2, double** knot1, double** knot2, 99 | double** coeff, bool& isRational, bool& isClosed1, bool& isClosed2, 100 | bool& isPeriodic1, bool& isPeriodic2, 101 | double& u0, double& u1, double& v0, double& v1 ) 102 | { 103 | if( !m_valid || NULL == m_entity ) 104 | return false; 105 | 106 | return ((IGES_ENTITY_128*)m_entity)->GetNURBSData( nCoeff1, nCoeff2, 107 | order1, order2, knot1, knot2, coeff, isRational, isClosed1, 108 | isClosed2, isPeriodic1, isPeriodic2, u0, u1, v0, v1 ); 109 | } 110 | 111 | 112 | bool DLL_IGES_ENTITY_128::SetNURBSData( int nCoeff1, int nCoeff2, 113 | int order1, int order2, const double* knot1, const double* knot2, 114 | const double* coeff, bool isRational, bool isPeriodic1, bool isPeriodic2, 115 | double u0, double u1, double v0, double v1 ) 116 | { 117 | if( !m_valid || NULL == m_entity ) 118 | return false; 119 | 120 | return ((IGES_ENTITY_128*)m_entity)->SetNURBSData( nCoeff1, nCoeff2, 121 | order1, order2, knot1, knot2, coeff, isRational, isPeriodic1, isPeriodic2, 122 | u0, u1, v0, v1 ); 123 | } 124 | 125 | 126 | bool DLL_IGES_ENTITY_128::IsRational( bool& aResult ) 127 | { 128 | if( !m_valid || NULL == m_entity ) 129 | return false; 130 | 131 | aResult = ((IGES_ENTITY_128*)m_entity)->IsRational(); 132 | return true; 133 | } 134 | 135 | 136 | bool DLL_IGES_ENTITY_128::isClosed1( bool& aResult ) 137 | { 138 | if( !m_valid || NULL == m_entity ) 139 | return false; 140 | 141 | aResult = ((IGES_ENTITY_128*)m_entity)->isClosed1(); 142 | return true; 143 | } 144 | 145 | 146 | bool DLL_IGES_ENTITY_128::isClosed2( bool& aResult ) 147 | { 148 | if( !m_valid || NULL == m_entity ) 149 | return false; 150 | 151 | aResult = ((IGES_ENTITY_128*)m_entity)->isClosed2(); 152 | return true; 153 | } 154 | 155 | 156 | bool DLL_IGES_ENTITY_128::isPeriodic1( bool& aResult ) 157 | { 158 | if( !m_valid || NULL == m_entity ) 159 | return false; 160 | 161 | aResult = ((IGES_ENTITY_128*)m_entity)->isPeriodic1(); 162 | return true; 163 | } 164 | 165 | 166 | bool DLL_IGES_ENTITY_128::isPeriodic2( bool& aResult ) 167 | { 168 | if( !m_valid || NULL == m_entity ) 169 | return false; 170 | 171 | aResult = ((IGES_ENTITY_128*)m_entity)->isPeriodic2(); 172 | return true; 173 | } 174 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity314.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity314.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 314: Color, Section 4.77, p.386 (414) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | using namespace std; 35 | 36 | 37 | DLL_IGES_ENTITY_314::DLL_IGES_ENTITY_314( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 38 | { 39 | m_type = ENT_COLOR_DEFINITION; 40 | 41 | if( create ) 42 | { 43 | if( NULL != aParent ) 44 | aParent->NewEntity( ENT_COLOR_DEFINITION, &m_entity ); 45 | else 46 | m_entity = new IGES_ENTITY_314( NULL ); 47 | 48 | if( NULL != m_entity ) 49 | m_entity->AttachValidFlag( &m_valid ); 50 | } 51 | 52 | return; 53 | } 54 | 55 | 56 | DLL_IGES_ENTITY_314::DLL_IGES_ENTITY_314( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 57 | { 58 | m_type = ENT_COLOR_DEFINITION; 59 | 60 | IGES* ip = aParent.GetRawPtr(); 61 | 62 | if( !create || NULL == ip ) 63 | return; 64 | 65 | ip->NewEntity( ENT_COLOR_DEFINITION, &m_entity ); 66 | 67 | if( NULL != m_entity ) 68 | m_entity->AttachValidFlag( &m_valid ); 69 | 70 | return; 71 | } 72 | 73 | 74 | DLL_IGES_ENTITY_314::~DLL_IGES_ENTITY_314() 75 | { 76 | return; 77 | } 78 | 79 | 80 | bool DLL_IGES_ENTITY_314::NewEntity( void ) 81 | { 82 | if( m_valid && NULL != m_entity ) 83 | { 84 | m_entity->DetachValidFlag( &m_valid ); 85 | m_entity = NULL; 86 | } 87 | 88 | if( NULL != m_parent && m_hasParent ) 89 | m_parent->NewEntity( ENT_COLOR_DEFINITION, &m_entity ); 90 | else 91 | m_entity = new IGES_ENTITY_314( NULL ); 92 | 93 | if( NULL != m_entity ) 94 | { 95 | m_entity->AttachValidFlag( &m_valid ); 96 | return true; 97 | } 98 | 99 | return false; 100 | } 101 | 102 | 103 | bool DLL_IGES_ENTITY_314::GetColor( double& aRed, double& aGreen, double& aBlue ) 104 | { 105 | if( !m_valid || NULL == m_entity ) 106 | return false; 107 | 108 | aRed = ((IGES_ENTITY_314*)m_entity)->red; 109 | aGreen = ((IGES_ENTITY_314*)m_entity)->green; 110 | aBlue = ((IGES_ENTITY_314*)m_entity)->blue; 111 | 112 | return true; 113 | } 114 | 115 | 116 | bool DLL_IGES_ENTITY_314::SetColor( double aRed, double aGreen, double aBlue ) 117 | { 118 | if( !m_valid || NULL == m_entity ) 119 | return false; 120 | 121 | if( aRed < 0.0 || aRed > 100.0 122 | || aGreen < 0.0 || aGreen > 100.0 123 | || aBlue < 0.0 || aBlue > 100.0 ) 124 | { 125 | ERRMSG << "\n + [BUG] invalid RGB value; range is 0.0 .. 100.0 for each component\n"; 126 | cerr << " + [INFO] RGB = (" << aRed << ", " << aGreen << ", " << aBlue << ")\n"; 127 | return false; 128 | } 129 | 130 | ((IGES_ENTITY_314*)m_entity)->red = aRed; 131 | ((IGES_ENTITY_314*)m_entity)->green = aGreen; 132 | ((IGES_ENTITY_314*)m_entity)->blue = aBlue; 133 | 134 | return true; 135 | } 136 | 137 | 138 | bool DLL_IGES_ENTITY_314::GetName( const char*& aName ) 139 | { 140 | if( !m_valid || NULL == m_entity ) 141 | return false; 142 | 143 | string* sp = &((IGES_ENTITY_314*)m_entity)->cname; 144 | 145 | if( sp->empty() ) 146 | { 147 | aName = NULL; 148 | return false; 149 | } 150 | 151 | aName = sp->c_str(); 152 | return true; 153 | } 154 | 155 | 156 | bool DLL_IGES_ENTITY_314::SetName( const char* aName ) 157 | { 158 | if( !m_valid || NULL == m_entity ) 159 | return false; 160 | 161 | if( NULL != aName ) 162 | ((IGES_ENTITY_314*)m_entity)->cname = aName; 163 | else 164 | ((IGES_ENTITY_314*)m_entity)->cname.clear(); 165 | 166 | return true; 167 | } 168 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity406.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity406.cpp 3 | * 4 | * Copyright 2017, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | DLL_IGES_ENTITY_406::DLL_IGES_ENTITY_406( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 32 | { 33 | m_type = ENT_PROPERTY; 34 | 35 | if( create ) 36 | { 37 | if( NULL != aParent ) 38 | aParent->NewEntity( ENT_PROPERTY, &m_entity ); 39 | else 40 | m_entity = new IGES_ENTITY_406( NULL ); 41 | 42 | if( NULL != m_entity ) 43 | m_entity->AttachValidFlag( &m_valid ); 44 | } 45 | 46 | return; 47 | } 48 | 49 | 50 | DLL_IGES_ENTITY_406::DLL_IGES_ENTITY_406( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 51 | { 52 | m_type = ENT_PROPERTY; 53 | IGES* ip = aParent.GetRawPtr(); 54 | 55 | if( !create || NULL == ip ) 56 | return; 57 | 58 | ip->NewEntity( ENT_PROPERTY, &m_entity ); 59 | 60 | if( NULL != m_entity ) 61 | m_entity->AttachValidFlag( &m_valid ); 62 | 63 | return; 64 | } 65 | 66 | 67 | DLL_IGES_ENTITY_406::~DLL_IGES_ENTITY_406() 68 | { 69 | return; 70 | } 71 | 72 | 73 | bool DLL_IGES_ENTITY_406::NewEntity( void ) 74 | { 75 | if( m_valid && NULL != m_entity ) 76 | { 77 | m_entity->DetachValidFlag( &m_valid ); 78 | m_entity = NULL; 79 | } 80 | 81 | if( NULL != m_parent && m_hasParent ) 82 | m_parent->NewEntity( ENT_PROPERTY, &m_entity ); 83 | else 84 | m_entity = new IGES_ENTITY_406( NULL ); 85 | 86 | if( NULL != m_entity ) 87 | { 88 | m_entity->AttachValidFlag(&m_valid); 89 | return true; 90 | } 91 | 92 | return false; 93 | } 94 | 95 | 96 | const char * DLL_IGES_ENTITY_406::GetProperty_Name( void ) 97 | { 98 | const char *result = NULL; 99 | IGES_ENTITY_406* ep = (IGES_ENTITY_406 *)m_entity; 100 | 101 | if( ep->GetEntityForm() == 15 ) 102 | { 103 | std::string *sp = (std::string *)ep->GetData(); 104 | result = sp->c_str(); 105 | } 106 | 107 | return result; 108 | } 109 | 110 | 111 | bool DLL_IGES_ENTITY_406::SetProperty_Name( const char * aName ) 112 | { 113 | bool result = false; 114 | 115 | IGES_ENTITY_406* ep = (IGES_ENTITY_406 *)m_entity; 116 | 117 | if( (ep->GetEntityForm() == 15) && (aName != NULL) ) 118 | { 119 | result = ep->SetData((void *) aName); 120 | } 121 | 122 | return result; 123 | } 124 | -------------------------------------------------------------------------------- /src/dllapi/dll_entity408.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity408.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | DLL_IGES_ENTITY_408::DLL_IGES_ENTITY_408( IGES* aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 32 | { 33 | m_type = ENT_SINGULAR_SUBFIGURE_INSTANCE; 34 | 35 | if( create ) 36 | { 37 | if( NULL != aParent ) 38 | aParent->NewEntity( ENT_SINGULAR_SUBFIGURE_INSTANCE, &m_entity ); 39 | else 40 | m_entity = new IGES_ENTITY_408( NULL ); 41 | 42 | if( NULL != m_entity ) 43 | m_entity->AttachValidFlag( &m_valid ); 44 | } 45 | 46 | return; 47 | } 48 | 49 | 50 | DLL_IGES_ENTITY_408::DLL_IGES_ENTITY_408( DLL_IGES& aParent, bool create ) : DLL_IGES_ENTITY( aParent ) 51 | { 52 | m_type = ENT_SINGULAR_SUBFIGURE_INSTANCE; 53 | IGES* ip = aParent.GetRawPtr(); 54 | 55 | if( !create || NULL == ip ) 56 | return; 57 | 58 | ip->NewEntity( ENT_SINGULAR_SUBFIGURE_INSTANCE, &m_entity ); 59 | 60 | if( NULL != m_entity ) 61 | m_entity->AttachValidFlag( &m_valid ); 62 | 63 | return; 64 | } 65 | 66 | 67 | DLL_IGES_ENTITY_408::~DLL_IGES_ENTITY_408() 68 | { 69 | return; 70 | } 71 | 72 | 73 | bool DLL_IGES_ENTITY_408::NewEntity( void ) 74 | { 75 | if( m_valid && NULL != m_entity ) 76 | { 77 | m_entity->DetachValidFlag( &m_valid ); 78 | m_entity = NULL; 79 | } 80 | 81 | if( NULL != m_parent && m_hasParent ) 82 | m_parent->NewEntity( ENT_SINGULAR_SUBFIGURE_INSTANCE, &m_entity ); 83 | else 84 | m_entity = new IGES_ENTITY_408( NULL ); 85 | 86 | if( NULL != m_entity ) 87 | { 88 | m_entity->AttachValidFlag(&m_valid); 89 | return true; 90 | } 91 | 92 | return false; 93 | } 94 | 95 | 96 | bool DLL_IGES_ENTITY_408::GetSubfigure( IGES_ENTITY_308*& aPtr ) 97 | { 98 | if( !m_valid || NULL == m_entity ) 99 | return false; 100 | 101 | return ((IGES_ENTITY_408*)m_entity)->GetDE( aPtr ); 102 | } 103 | 104 | 105 | bool DLL_IGES_ENTITY_408::SetSubfigure( IGES_ENTITY_308* aPtr ) 106 | { 107 | if( !m_valid || NULL == m_entity ) 108 | return false; 109 | 110 | return ((IGES_ENTITY_408*)m_entity)->SetDE( aPtr ); 111 | } 112 | 113 | 114 | bool DLL_IGES_ENTITY_408::GetSubfigParams( double& aX, double& aY, double& aZ, double& aScale ) 115 | { 116 | if( !m_valid || NULL == m_entity ) 117 | return false; 118 | 119 | IGES_ENTITY_408* ip = (IGES_ENTITY_408*)m_entity; 120 | aX = ip->X; 121 | aY = ip->Y; 122 | aZ = ip->Z; 123 | aScale = ip->S; 124 | return true; 125 | } 126 | 127 | 128 | bool DLL_IGES_ENTITY_408::SetSubfigParams( double aX, double aY, double aZ, double aScale ) 129 | { 130 | if( !m_valid || NULL == m_entity ) 131 | return false; 132 | 133 | IGES_ENTITY_408* ip = (IGES_ENTITY_408*)m_entity; 134 | ip->X = aX; 135 | ip->Y = aY; 136 | ip->Z = aZ; 137 | ip->S = aScale; 138 | return true; 139 | } 140 | 141 | 142 | bool DLL_IGES_ENTITY_408::GetDE( IGES_ENTITY_308*& aPtr ) 143 | { 144 | if( !m_valid || NULL == m_entity ) 145 | return false; 146 | 147 | return ((IGES_ENTITY_408*)m_entity)->GetDE( aPtr ); 148 | } 149 | 150 | 151 | bool DLL_IGES_ENTITY_408::SetDE( IGES_ENTITY_308* aPtr ) 152 | { 153 | if( !m_valid || NULL == m_entity ) 154 | return false; 155 | 156 | return ((IGES_ENTITY_408*)m_entity)->SetDE( aPtr ); 157 | } 158 | -------------------------------------------------------------------------------- /src/dllapi/dll_iges_curve.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_iges_curve.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | 34 | DLL_IGES_CURVE::DLL_IGES_CURVE( IGES* aParent ) : DLL_IGES_ENTITY( aParent ) 35 | { 36 | return; 37 | } 38 | 39 | DLL_IGES_CURVE::DLL_IGES_CURVE( DLL_IGES& aParent ) : DLL_IGES_ENTITY( aParent ) 40 | { 41 | return; 42 | } 43 | 44 | DLL_IGES_CURVE::~DLL_IGES_CURVE() 45 | { 46 | return; 47 | } 48 | 49 | 50 | bool DLL_IGES_CURVE::IsClosed( void ) 51 | { 52 | if( !m_valid || NULL == m_entity ) 53 | { 54 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 55 | return false; 56 | } 57 | 58 | return ((IGES_CURVE*)m_entity)->IsClosed(); 59 | } 60 | 61 | 62 | int DLL_IGES_CURVE::GetNCurves( void ) 63 | { 64 | if( !m_valid || NULL == m_entity ) 65 | { 66 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 67 | return 0; 68 | } 69 | 70 | return ((IGES_CURVE*)m_entity)->GetNCurves(); 71 | } 72 | 73 | 74 | IGES_CURVE* DLL_IGES_CURVE::GetCurve( int index ) 75 | { 76 | if( !m_valid || NULL == m_entity ) 77 | { 78 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 79 | return NULL; 80 | } 81 | 82 | return ((IGES_CURVE*)m_entity)->GetCurve( index ); 83 | } 84 | 85 | 86 | bool DLL_IGES_CURVE::GetStartPoint( MCAD_POINT& pt, bool xform ) 87 | { 88 | if( !m_valid || NULL == m_entity ) 89 | { 90 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 91 | return false; 92 | } 93 | 94 | return ((IGES_CURVE*)m_entity)->GetStartPoint( pt, xform ); 95 | } 96 | 97 | 98 | bool DLL_IGES_CURVE::GetEndPoint( MCAD_POINT& pt, bool xform ) 99 | { 100 | if( !m_valid || NULL == m_entity ) 101 | { 102 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 103 | return false; 104 | } 105 | 106 | return ((IGES_CURVE*)m_entity)->GetEndPoint( pt, xform ); 107 | } 108 | 109 | 110 | int DLL_IGES_CURVE::GetNSegments( void ) 111 | { 112 | if( !m_valid || NULL == m_entity ) 113 | { 114 | ERRMSG << "\n + [BUG] invalid IGES_ENTITY object\n"; 115 | return 0; 116 | } 117 | 118 | return ((IGES_CURVE*)m_entity)->GetNSegments(); 119 | } 120 | -------------------------------------------------------------------------------- /src/entities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # file: entities/CMakeLists.txt 2 | #add_library( iges SHARED 3 | # iges_entity.cpp 4 | # entityNULL.cpp 5 | # ) 6 | -------------------------------------------------------------------------------- /src/entities/entity_template.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity_template.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 0: NULL, Section 4.2, p.65 (93) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #error This is a template only and not suitable for compilation or inclusion 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | using namespace std; 36 | 37 | 38 | bool IGES_ENTITY_TEMP::Associate( std::vector* entities ) 39 | { 40 | // XXX - TO BE IMPLEMENTED 41 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 42 | return false; 43 | } 44 | 45 | 46 | bool IGES_ENTITY_TEMP::format( int &index ) 47 | { 48 | // XXX - TO BE IMPLEMENTED 49 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 50 | return false; 51 | } 52 | 53 | 54 | bool IGES_ENTITY_TEMP::rescale( double sf ) 55 | { 56 | // XXX - TO BE IMPLEMENTED 57 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 58 | return false; 59 | } 60 | 61 | 62 | bool IGES_ENTITY_TEMP::Unlink( IGES_ENTITY* aChildEntity ) 63 | { 64 | // XXX - TO BE IMPLEMENTED 65 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 66 | return false; 67 | } 68 | 69 | 70 | bool IGES_ENTITY_TEMP::isOrphaned( void ) 71 | { 72 | if( refs.empty() && depends != STAT_INDEPENDENT ) 73 | return true; 74 | 75 | return false; 76 | } 77 | 78 | 79 | bool IGES_ENTITY_TEMP::AddReference( IGES_ENTITY* aParentEntity, 80 | bool& isDuplicate ) 81 | { 82 | // XXX - TO BE IMPLEMENTED 83 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 84 | return false; 85 | } 86 | 87 | 88 | bool IGES_ENTITY_TEMP::DelReference( IGES_ENTITY* aParentEntity ) 89 | { 90 | // XXX - TO BE IMPLEMENTED 91 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 92 | return false; 93 | } 94 | 95 | 96 | bool IGES_ENTITY_TEMP::ReadDE( IGES_RECORD* aRecord, std::ifstream& aFile, int& aSequenceVar ) 97 | { 98 | // XXX - TO BE IMPLEMENTED 99 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 100 | return false; 101 | } 102 | 103 | 104 | bool IGES_ENTITY_TEMP::ReadPD( std::ifstream& aFile, int& aSequenceVar ) 105 | { 106 | // XXX - TO BE IMPLEMENTED 107 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 108 | return false; 109 | } 110 | 111 | 112 | bool IGES_ENTITY_TEMP::SetEntityForm( int aForm ) 113 | { 114 | // XXX - TO BE IMPLEMENTED 115 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 116 | return false; 117 | } 118 | 119 | 120 | bool IGES_ENTITY_TEMP::SetDependency( IGES_STAT_DEPENDS aDependency ) 121 | { 122 | // XXX - TO BE IMPLEMENTED 123 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 124 | return false; 125 | } 126 | 127 | 128 | bool IGES_ENTITY_TEMP::SetEntityUse( IGES_STAT_USE aUseCase ) 129 | { 130 | // XXX - TO BE IMPLEMENTED 131 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 132 | return false; 133 | } 134 | 135 | 136 | bool IGES_ENTITY_TEMP::SetHierarchy( IGES_STAT_HIER aHierarchy ) 137 | { 138 | // XXX - TO BE IMPLEMENTED 139 | ERRMSG << "\n + [WARNING] TO BE IMPLEMENTED\n"; 140 | return false; 141 | } 142 | -------------------------------------------------------------------------------- /src/entities/iges_curve.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: iges_curve.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: Base entity of all IGES Entity classes. 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | // Note: This base class must never be instantiated. 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | 37 | IGES_CURVE::IGES_CURVE(IGES* aParent) : IGES_ENTITY( aParent ) 38 | { 39 | return; 40 | } // IGES_CURVE::IGES_CURVE(IGES*) 41 | 42 | 43 | IGES_CURVE::~IGES_CURVE() 44 | { 45 | return; 46 | } 47 | -------------------------------------------------------------------------------- /src/geom/mcad_helpers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: mcad_helpers.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: miscellaneous useful functions 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | 37 | using namespace std; 38 | 39 | 40 | // return true if the 2 points match to within 'minRes' 41 | // or best effort if the numbers are big 42 | bool PointMatches( MCAD_POINT p1, MCAD_POINT p2, double minRes ) 43 | { 44 | // determine if we can in fact meet the minRes specification 45 | double dN = abs( p1.x*p1.x + p1.y*p1.y + p1.z*p1.z ); 46 | double dV = abs( p2.x*p2.x + p2.y*p2.y + p2.z*p2.z ); 47 | 48 | double rN = dN / minRes; 49 | double rV = dV / minRes; 50 | 51 | // if minRes cannot be guaranteed in the calculation 52 | // then create a generous new boundary which should 53 | // ideally minimize mischaracterizations 54 | if( dN > 1e15 || dV > 1e15 ) 55 | { 56 | rN = 1.0 / sqrt(max( dN, dV )); 57 | p1 *= rN; 58 | p2 *= rN; 59 | minRes *= rN; 60 | } 61 | 62 | minRes *= 3.0001 * minRes; 63 | 64 | if( minRes < 3.0e-30 ) 65 | minRes = 3.0e-30; 66 | 67 | dN = p2.x - p1.x; 68 | dV = p2.y - p1.y; 69 | rN = p2.z - p1.z; 70 | rV = dN*dN + dV*dV + rN*rN; 71 | 72 | if( rV > minRes ) 73 | return false; 74 | 75 | return true; 76 | } 77 | 78 | 79 | bool CheckNormal( double& X, double &Y, double& Z ) 80 | { 81 | double dN = X*X + Y*Y + Z*Z; 82 | 83 | if( dN < 1e-12 ) 84 | { 85 | // NOTE: XXX - this may yet be an essential check but for now it is 86 | // disabled because it spams the console 87 | // ERRMSG << "\n + [INFO] bad vector (cannot be normalized); reverting to z-normal\n"; 88 | X = 0.0; 89 | Y = 0.0; 90 | Z = 1.0; 91 | return true; 92 | } 93 | 94 | double dV = dN - 1.0; 95 | 96 | if( dV < -1e-8 || dV > 1e-8 ) 97 | { 98 | dV = sqrt(dN); 99 | X /= dV; 100 | Y /= dV; 101 | Z /= dV; 102 | } 103 | 104 | return true; 105 | } 106 | 107 | 108 | void print_transform( const MCAD_TRANSFORM* T ) 109 | { 110 | cerr << setprecision( 3 ); 111 | cerr << "R1: " << T->R.v[0][0] << ", " << T->R.v[0][1] << ", " << T->R.v[0][2] << ", T.x = " << T->T.x << "\n"; 112 | cerr << "R2: " << T->R.v[1][0] << ", " << T->R.v[1][1] << ", " << T->R.v[1][2] << ", T.y = " << T->T.y << "\n"; 113 | cerr << "R3: " << T->R.v[2][0] << ", " << T->R.v[2][1] << ", " << T->R.v[2][2] << ", T.z = " << T->T.z << "\n"; 114 | return; 115 | } 116 | 117 | 118 | void print_matrix( const MCAD_MATRIX* m ) 119 | { 120 | cerr << setprecision( 3 ); 121 | cerr << "R1: " << m->v[0][0] << ", " << m->v[0][1] << ", " << m->v[0][2] << "\n"; 122 | cerr << "R2: " << m->v[1][0] << ", " << m->v[1][1] << ", " << m->v[1][2] << "\n"; 123 | cerr << "R3: " << m->v[2][0] << ", " << m->v[2][1] << ", " << m->v[2][2] << "\n"; 124 | return; 125 | } 126 | 127 | 128 | void print_vec( const MCAD_POINT* p ) 129 | { 130 | cerr << setprecision( 3 ); 131 | cerr << "V: " << p->x << ", " << p->y << ", " << p->z << "\n"; 132 | return; 133 | } 134 | 135 | 136 | // calculate the normal given points p0, p1, p2 137 | bool CalcNormal( const MCAD_POINT* p0, const MCAD_POINT* p1, const MCAD_POINT* p2, MCAD_POINT* pn ) 138 | { 139 | if( !p0 || !p1 || !p2 || !pn ) 140 | { 141 | ERRMSG << "\n + [ERROR] NULL pointer passed as an argument\n"; 142 | return false; 143 | } 144 | 145 | MCAD_POINT tp0( *p0 ); 146 | MCAD_POINT tp1( *p1 ); 147 | MCAD_POINT tp2( *p2 ); 148 | 149 | MCAD_POINT t0 = tp1 - tp0; 150 | MCAD_POINT t1 = tp2 - tp0; 151 | 152 | pn->x = t0.y * t1.z - t0.z * t1.y; 153 | pn->y = t0.z * t1.x - t0.x * t1.z; 154 | pn->z = t0.x * t1.y - t0.y * t1.x; 155 | 156 | return CheckNormal( pn->x, pn->y, pn->z ); 157 | } 158 | -------------------------------------------------------------------------------- /src/idf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | "${CMAKE_CURRENT_SOURCE_DIR}" 3 | ) 4 | 5 | add_library( idf3 STATIC 6 | idf_helpers.cpp idf_common.cpp idf_outlines.cpp 7 | idf_parser.cpp ) 8 | 9 | add_executable( idf2igs idf2igs.cpp ) 10 | target_link_libraries( idf2igs ${IGES_LIBS} idf3 ) 11 | 12 | install( TARGETS idf2igs 13 | RUNTIME DESTINATION ${LIBIGES_BINDIR} 14 | ) 15 | -------------------------------------------------------------------------------- /src/iges/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # file: iges/CMakeLists.txt 2 | -------------------------------------------------------------------------------- /src/include/api/all_api_entities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: all_api_entities.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES top level object for input, output and manipulation 7 | * of IGES entity data via a DLL interface 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | 29 | #ifndef ALL_API_ENTITIES_H 30 | #define ALL_API_ENTITIES_H 31 | 32 | // declare the core IGES classes 33 | class IGES_ENTITY; 34 | class IGES_ENTITY_100; 35 | class IGES_ENTITY_102; 36 | class IGES_ENTITY_104; 37 | class IGES_ENTITY_110; 38 | class IGES_ENTITY_120; 39 | class IGES_ENTITY_122; 40 | class IGES_ENTITY_124; 41 | class IGES_ENTITY_126; 42 | class IGES_ENTITY_128; 43 | class IGES_ENTITY_142; 44 | class IGES_ENTITY_144; 45 | class IGES_ENTITY_308; 46 | class IGES_ENTITY_314; 47 | class IGES_ENTITY_406; 48 | class IGES_ENTITY_408; 49 | 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | /* 62 | #include 63 | #include 64 | #include 65 | #include 66 | */ 67 | #include 68 | #include 69 | #include 70 | #include 71 | /* 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | */ 78 | 79 | #endif // ALL_API_ENTITIES_H 80 | -------------------------------------------------------------------------------- /src/include/api/dll_entity100.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity100.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | 26 | #ifndef DLL_ENTITY_100_H 27 | #define DLL_ENTITY_100_H 28 | 29 | #include 30 | #include 31 | 32 | class MCAD_API DLL_IGES_ENTITY_100 : public DLL_IGES_CURVE 33 | { 34 | public: 35 | // note: all implementations must have constructors which: 36 | // a. takes a IGES* and creation flag 37 | // b. takes a DLL_IGES& and creation flag 38 | // If the creation flag is 'true' then a new IGES_ENTITY 39 | // of the specified type is created; otherwise the DLL entity 40 | // serves as a convenient manipulator of an IGES_ENTITY to 41 | // be specified by the user. 42 | DLL_IGES_ENTITY_100( IGES* aParent, bool create ); 43 | DLL_IGES_ENTITY_100( DLL_IGES& aParent, bool create ); 44 | virtual ~DLL_IGES_ENTITY_100(); 45 | 46 | virtual bool NewEntity( void ); 47 | 48 | bool GetCircleCenter( double& aX, double& aY, double& aZ ) const; 49 | bool GetCircleCenter( MCAD_POINT& aPoint ) const; 50 | 51 | bool GetCircleStart( double& aX, double& aY, double& aZ ) const; 52 | bool GetCircleStart( MCAD_POINT& aPoint ) const; 53 | 54 | bool GetCircleEnd( double& aX, double& aY, double& aZ ) const; 55 | bool GetCircleEnd( MCAD_POINT& aPoint ) const; 56 | 57 | bool SetCircleCenter( double aX, double aY, double aZ ); 58 | bool SetCircleCenter( const MCAD_POINT& aPoint ); 59 | 60 | bool SetCircleStart( double aX, double aY ); 61 | bool SetCircleStart( const MCAD_POINT& aPoint ); 62 | 63 | bool SetCircleEnd( double aX, double aY ); 64 | bool SetCircleEnd( const MCAD_POINT& aPoint ); 65 | }; 66 | 67 | #endif // DLL_ENTITY_100_H 68 | -------------------------------------------------------------------------------- /src/include/api/dll_entity102.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity102.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 102: Composite Curve, Section 4.4, p.69+ (97+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_102_H 30 | #define DLL_ENTITY_102_H 31 | 32 | #include 33 | #include 34 | 35 | 36 | class MCAD_API DLL_IGES_ENTITY_102 : public DLL_IGES_CURVE 37 | { 38 | public: 39 | DLL_IGES_ENTITY_102( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_102( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_102(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool AddSegment( IGES_CURVE* aSegment ); 46 | bool AddSegment( DLL_IGES_CURVE& aSegment ); 47 | }; 48 | 49 | #endif // DLL_ENTITY_102_H 50 | -------------------------------------------------------------------------------- /src/include/api/dll_entity104.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity104.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 104: Conic Arc, Section 4.5, p.74+ (102+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_104_H 30 | #define DLL_ENTITY_104_H 31 | 32 | #include 33 | #include 34 | 35 | 36 | class MCAD_API DLL_IGES_ENTITY_104 : public DLL_IGES_CURVE 37 | { 38 | public: 39 | DLL_IGES_ENTITY_104( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_104( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_104(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool GetConicStart( MCAD_POINT& pt ); 46 | bool GetConicStart( double& aX, double& aY, double& aZ ); 47 | bool GetConicEnd( double& aX, double& aY, double& aZ ); 48 | bool GetConicEnd( MCAD_POINT& pt ); 49 | bool GetConicParams( double& P1, double& P2, double& P3, double& P4, 50 | double& P5, double& P6 ); 51 | 52 | bool SetConicStart( MCAD_POINT pt ); 53 | bool SetConicStart( double aX, double aY, double aZ ); 54 | bool SetConicEnd( MCAD_POINT pt ); 55 | bool SetConicEnd( double aX, double aY ); 56 | bool SetConicParams( double P1, double P2, double P3, double P4, 57 | double P5, double P6 ); 58 | }; 59 | 60 | #endif // DLL_ENTITY_104_H 61 | -------------------------------------------------------------------------------- /src/include/api/dll_entity110.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity110.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 110: Line, Section 4.13, p.96+ (124+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_110_H 30 | #define DLL_ENTITY_110_H 31 | 32 | #include 33 | #include 34 | 35 | class MCAD_API DLL_IGES_ENTITY_110 : public DLL_IGES_CURVE 36 | { 37 | public: 38 | DLL_IGES_ENTITY_110( IGES* aParent, bool create ); 39 | DLL_IGES_ENTITY_110( DLL_IGES& aParent, bool create ); 40 | virtual ~DLL_IGES_ENTITY_110(); 41 | 42 | virtual bool NewEntity( void ); 43 | 44 | bool GetLineStart( MCAD_POINT& pt ); 45 | bool GetLineStart( double& aX, double& aY, double& aZ ); 46 | bool GetLineEnd( MCAD_POINT& pt ); 47 | bool GetLineEnd( double& aX, double& aY, double& aZ ); 48 | 49 | bool SetLineStart( MCAD_POINT pt ); 50 | bool SetLineStart( double aX, double aY, double aZ ); 51 | bool SetLineEnd( MCAD_POINT pt ); 52 | bool SetLineEnd( double aX, double aY, double aZ ); 53 | }; 54 | 55 | #endif // DLL_ENTITY_110_H 56 | -------------------------------------------------------------------------------- /src/include/api/dll_entity120.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity120.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 120: Surface of Revolution, Section 4.18, p.116+ (144+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_120_H 30 | #define DLL_ENTITY_120_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | 37 | class MCAD_API DLL_IGES_ENTITY_120 : public DLL_IGES_ENTITY 38 | { 39 | public: 40 | DLL_IGES_ENTITY_120( IGES* aParent, bool create ); 41 | DLL_IGES_ENTITY_120( DLL_IGES& aParent, bool create ); 42 | virtual ~DLL_IGES_ENTITY_120(); 43 | 44 | virtual bool NewEntity( void ); 45 | 46 | bool GetAxis( IGES_CURVE** aCurve ); 47 | bool SetAxis( IGES_CURVE* aCurve ); 48 | bool SetAxis( DLL_IGES_CURVE& aCurve ); 49 | bool GetGeneratrix( IGES_CURVE** aCurve ); 50 | bool SetGeneratrix( IGES_CURVE* aCurve ); 51 | bool SetGeneratrix( DLL_IGES_CURVE& aCurve ); 52 | bool GetAngles( double& aStartAngle, double& aEndAngle ); 53 | bool SetAngles( double aStartAngle, double aEndAngle ); 54 | }; 55 | 56 | #endif // ENTITY_TEMP_H 57 | -------------------------------------------------------------------------------- /src/include/api/dll_entity122.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity122.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 122: Tabulated Cylinder, Section 4.19, p.119(147+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_122_H 30 | #define DLL_ENTITY_122_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | class MCAD_API DLL_IGES_ENTITY_122 : public DLL_IGES_ENTITY 37 | { 38 | public: 39 | DLL_IGES_ENTITY_122( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_122( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_122(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool GetGeneratrixEnd( MCAD_POINT& pt ); 46 | bool GetGeneratrixEnd( double& aX, double& aY, double& aZ ); 47 | bool GetDirectrix( IGES_CURVE*& aPtr ); 48 | bool SetGeneratrixEnd( MCAD_POINT pt ); 49 | bool SetGeneratrixEnd( double aX, double aY, double aZ ); 50 | bool SetDirectrix( IGES_CURVE* aPtr ); 51 | }; 52 | 53 | #endif // DLL_ENTITY_122_H 54 | -------------------------------------------------------------------------------- /src/include/api/dll_entity124.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity124.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 124: Transformation Matrix, Section 4.21, p.123+ (151+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_124_H 30 | #define DLL_ENTITY_124_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | class MCAD_API DLL_IGES_ENTITY_124 : public DLL_IGES_ENTITY 37 | { 38 | public: 39 | DLL_IGES_ENTITY_124( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_124( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_124(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool GetOverallTransform( MCAD_TRANSFORM& aTX ); 46 | bool GetRootTransform( MCAD_TRANSFORM& aTX ); 47 | bool SetRootTransform( MCAD_TRANSFORM* aTX ); 48 | bool SetRootTransform( MCAD_TRANSFORM& aTX ); 49 | // XXX - add DLL_ENTITY accessors 50 | }; 51 | 52 | #endif // DLL_ENTITY_124_H 53 | -------------------------------------------------------------------------------- /src/include/api/dll_entity126.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity126.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #ifndef DLL_ENTITY_126_H 26 | #define DLL_ENTITY_126_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class MCAD_API DLL_IGES_ENTITY_126 : public DLL_IGES_CURVE 33 | { 34 | public: 35 | DLL_IGES_ENTITY_126( IGES* aParent, bool create ); 36 | DLL_IGES_ENTITY_126( DLL_IGES& aParent, bool create ); 37 | virtual ~DLL_IGES_ENTITY_126(); 38 | 39 | virtual bool NewEntity( void ); 40 | 41 | bool GetNURBSData( int& nCoeff, int& order, double** knot, double** coeff, 42 | bool& isRational, bool& isClosed, bool& isPeriodic, double& v0, double& v1 ); 43 | bool SetNURBSData( int nCoeff, int order, const double* knot, const double* coeff, 44 | bool isRational, double v0, double v1 ); 45 | bool IsPlanar( bool& aResult ); 46 | bool IsRational( bool& aResult ); 47 | bool isPeriodic( bool& aResult ); 48 | bool GetNormal( MCAD_POINT& aNorm ); 49 | }; 50 | 51 | #endif // DLL_ENTITY_126_H 52 | -------------------------------------------------------------------------------- /src/include/api/dll_entity128.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity128.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 128: NURBS Surface, Section 4.24, p.137(165+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_128_H 30 | #define DLL_ENTITY_128_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | 37 | class MCAD_API DLL_IGES_ENTITY_128 : public DLL_IGES_ENTITY 38 | { 39 | public: 40 | DLL_IGES_ENTITY_128( IGES* aParent, bool create ); 41 | DLL_IGES_ENTITY_128( DLL_IGES& aParent, bool create ); 42 | virtual ~DLL_IGES_ENTITY_128(); 43 | 44 | virtual bool NewEntity( void ); 45 | 46 | bool GetNURBSData( int& nCoeff1, int& nCoeff2, int& order1, int& order2, 47 | double** knot1, double** knot2, double** coeff, 48 | bool& isRational, bool& isClosed1, bool& isClosed2, 49 | bool& isPeriodic1, bool& isPeriodic2, 50 | double& u0, double& u1, double& v0, double& v1 ); 51 | 52 | bool SetNURBSData( int nCoeff1, int nCoeff2, int order1, int order2, 53 | const double* knot1, const double* knot2, 54 | const double* coeff, bool isRational, 55 | bool isPeriodic1, bool isPeriodic2, 56 | double u0, double u1, double v0, double v1 ); 57 | 58 | bool IsRational( bool& aResult ); 59 | bool isClosed1( bool& aResult ); 60 | bool isClosed2( bool& aResult ); 61 | bool isPeriodic1( bool& aResult ); 62 | bool isPeriodic2( bool& aResult ); 63 | }; 64 | 65 | #endif // DLL_ENTITY_128_H 66 | -------------------------------------------------------------------------------- /src/include/api/dll_entity142.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity142.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 142: Curve on a Parametric Surface, Section 4.32, p.178 (206+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_142_H 30 | #define DLL_ENTITY_142_H 31 | 32 | #include 33 | #include 34 | 35 | enum BOUND_CURVE_PREF 36 | { 37 | BOUND_PREF_UNSPECIFIED = 0, 38 | BOUND_PREF_PARAMSPACE, 39 | BOUND_PREF_MODELSPACE, 40 | BOUND_PREF_ANY 41 | }; 42 | 43 | 44 | enum CURVE_CREATION 45 | { 46 | CURVE_CREATE_UNSPECIFIED = 0, 47 | CURVE_CREATE_PROJECTION, 48 | CURVE_CREATE_INTERSECTION, 49 | CURVE_CREATE_PARAMETRIC 50 | }; 51 | 52 | 53 | class MCAD_API DLL_IGES_ENTITY_142 : public DLL_IGES_ENTITY 54 | { 55 | public: 56 | DLL_IGES_ENTITY_142( IGES* aParent, bool create ); 57 | DLL_IGES_ENTITY_142( DLL_IGES& aParent, bool create ); 58 | virtual ~DLL_IGES_ENTITY_142(); 59 | 60 | virtual bool NewEntity( void ); 61 | 62 | bool GetSurface( IGES_ENTITY** aPtr ); 63 | bool SetSurface( IGES_ENTITY* aPtr ); 64 | bool SetSurface( DLL_IGES_ENTITY& aPtr ); 65 | bool GetParameterSpaceBound( IGES_ENTITY** aPtr ); 66 | bool SetParameterSpaceBound( IGES_ENTITY* aPtr ); 67 | bool SetParameterSpaceBound( DLL_IGES_ENTITY& aPtr ); 68 | bool GetModelSpaceBound( IGES_ENTITY** aPtr ); 69 | bool SetModelSpaceBound( IGES_ENTITY* aPtr ); 70 | bool SetModelSpaceBound( DLL_IGES_ENTITY& aPtr ); 71 | bool GetCurvePreference( BOUND_CURVE_PREF& aPref ); 72 | bool SetCurvePreference( BOUND_CURVE_PREF aPref ); 73 | bool GetCurveCreationFlag( CURVE_CREATION& aFlag ); 74 | bool SetCurveCreationFlag( CURVE_CREATION aFlag ); 75 | }; 76 | 77 | #endif // DLL_ENTITY_142_H 78 | -------------------------------------------------------------------------------- /src/include/api/dll_entity144.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity144.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 144: Trimmed Parametric Surface, Section 4.34, p.181 (209+) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef DLL_ENTITY_144_H 28 | #define DLL_ENTITY_144_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | class IGES_ENTITY_142; 35 | 36 | class MCAD_API DLL_IGES_ENTITY_144 : public DLL_IGES_ENTITY 37 | { 38 | public: 39 | DLL_IGES_ENTITY_144( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_144( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_144(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool GetSurface( IGES_ENTITY*& aPtr ); 46 | bool SetSurface( IGES_ENTITY* aPtr ); 47 | bool SetSurface( DLL_IGES_ENTITY& aPtr ); 48 | bool GetBoundCurve( IGES_ENTITY_142*& aPtr ); 49 | bool SetBoundCurve( IGES_ENTITY_142* aPtr ); 50 | bool SetBoundCurve( DLL_IGES_ENTITY_142& aPtr ); 51 | bool GetNCutouts( int& aNCutouts ); 52 | bool GetCutouts( size_t& aListSize, IGES_ENTITY_142**& aCutoutList ); 53 | bool AddCutout( IGES_ENTITY_142* aPtr ); 54 | bool AddCutout( DLL_IGES_ENTITY_142& aPtr ); 55 | bool DelCutout( IGES_ENTITY_142* aPtr ); 56 | bool DelCutout( DLL_IGES_ENTITY_142& aPtr ); 57 | }; 58 | 59 | #endif // DLL_ENTITY_144_H 60 | -------------------------------------------------------------------------------- /src/include/api/dll_entity308.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity308.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 308: Subfigure Definition Entity, Section 4.74, p.377(405+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_308_H 30 | #define DLL_ENTITY_308_H 31 | 32 | #include 33 | #include 34 | 35 | 36 | class MCAD_API DLL_IGES_ENTITY_308 : public DLL_IGES_ENTITY 37 | { 38 | public: 39 | DLL_IGES_ENTITY_308( IGES* aParent, bool create ); 40 | DLL_IGES_ENTITY_308( DLL_IGES& aParent, bool create ); 41 | virtual ~DLL_IGES_ENTITY_308(); 42 | 43 | virtual bool NewEntity( void ); 44 | 45 | bool GetNumDE( size_t& aDESize ); 46 | bool GetDEList( size_t& aDESize, IGES_ENTITY**& aDEList ); 47 | bool AddDE(IGES_ENTITY* aPtr); 48 | bool AddDE(DLL_IGES_ENTITY*& aPtr); 49 | bool DelDE( IGES_ENTITY* aPtr ); 50 | bool DelDE(DLL_IGES_ENTITY*& aPtr); 51 | bool GetNestDepth( int& aNestDepth ); 52 | bool GetName( const char*& aName ); 53 | bool SetName( const char* aName ); 54 | }; 55 | 56 | #endif // DLL_ENTITY_308_H 57 | -------------------------------------------------------------------------------- /src/include/api/dll_entity314.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity314.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 314: Color, Section 4.77, p.386 (414) 27 | */ 28 | 29 | #ifndef DLL_ENTITY314_H 30 | #define DLL_ENTITY314_H 31 | 32 | #include 33 | #include 34 | 35 | class MCAD_API DLL_IGES_ENTITY_314 : public DLL_IGES_ENTITY 36 | { 37 | public: 38 | DLL_IGES_ENTITY_314( IGES* aParent, bool create ); 39 | DLL_IGES_ENTITY_314( DLL_IGES& aParent, bool create ); 40 | virtual ~DLL_IGES_ENTITY_314(); 41 | 42 | virtual bool NewEntity( void ); 43 | 44 | bool GetColor( double& aRed, double& aGreen, double& aBlue ); 45 | bool SetColor( double aRed, double aGreen, double aBlue ); 46 | bool GetName( const char*& aName ); 47 | bool SetName( const char* aName ); 48 | }; 49 | 50 | #endif // DLL_ENTITY314_H 51 | -------------------------------------------------------------------------------- /src/include/api/dll_entity406.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity406.h 3 | * 4 | * Copyright 2017, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 406: Property Entity, Section 4.98, p.476 (504) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_406_H 30 | #define DLL_ENTITY_406_H 31 | 32 | #include 33 | #include 34 | 35 | class MCAD_API DLL_IGES_ENTITY_406 : public DLL_IGES_ENTITY 36 | { 37 | public: 38 | DLL_IGES_ENTITY_406( IGES* aParent, bool create ); 39 | DLL_IGES_ENTITY_406( DLL_IGES& aParent, bool create ); 40 | virtual ~DLL_IGES_ENTITY_406(); 41 | 42 | virtual bool NewEntity( void ); 43 | 44 | // ======================================================================== 45 | // Type / Form specific operators 46 | // ======================================================================== 47 | 48 | // Form 15: Name 49 | 50 | // Returns a pointer to the Name if the Property is Form 15, otherwise NULL. 51 | const char *GetProperty_Name( void ); 52 | 53 | // Sets the name and returns true if the Property is Form 15, 54 | // otherwise makes no changes and returns false. The name is 55 | // stored as a Hollerith string and in principle is only limited 56 | // by the number of remaining Property Entity lines. 57 | bool SetProperty_Name( const char * aName ); 58 | }; 59 | 60 | #endif // DLL_ENTITY_406_H 61 | -------------------------------------------------------------------------------- /src/include/api/dll_entity408.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_entity408.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 4-8: Subfigure Instance, Section 4.137, p.557(585+) 27 | */ 28 | 29 | #ifndef DLL_ENTITY_408_H 30 | #define DLL_ENTITY_408_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | class IGES_ENTITY_308; 37 | 38 | class MCAD_API DLL_IGES_ENTITY_408 : public DLL_IGES_ENTITY 39 | { 40 | public: 41 | DLL_IGES_ENTITY_408( IGES* aParent, bool create ); 42 | DLL_IGES_ENTITY_408( DLL_IGES& aParent, bool create ); 43 | virtual ~DLL_IGES_ENTITY_408(); 44 | 45 | virtual bool NewEntity( void ); 46 | 47 | bool GetSubfigure( IGES_ENTITY_308*& aPtr ); 48 | bool SetSubfigure( IGES_ENTITY_308* aPtr ); 49 | bool GetSubfigParams( double& aX, double& aY, double& aZ, double& aScale ); 50 | bool SetSubfigParams( double aX, double aY, double aZ, double aScale = 1.0 ); 51 | bool GetDE( IGES_ENTITY_308*& aPtr ); 52 | bool SetDE( IGES_ENTITY_308* aPtr ); 53 | }; 54 | 55 | #endif // DLL_ENTITY_408_H 56 | -------------------------------------------------------------------------------- /src/include/api/dll_iges_curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: dll_iges_curve.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #ifndef DLL_IGES_CURVE_H 26 | #define DLL_IGES_CURVE_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class IGES_ENTITY; 33 | class IGES_CURVE; 34 | 35 | /** 36 | * Class IGES_CURVE 37 | * is the base class of all IGES Curve entities 38 | */ 39 | class MCAD_API DLL_IGES_CURVE : public DLL_IGES_ENTITY 40 | { 41 | public: 42 | DLL_IGES_CURVE( IGES* aParent ); 43 | DLL_IGES_CURVE( DLL_IGES& aParent ); 44 | virtual ~DLL_IGES_CURVE(); 45 | 46 | virtual bool NewEntity( void ) = 0; 47 | 48 | bool IsClosed( void ); 49 | int GetNCurves( void ); 50 | IGES_CURVE* GetCurve( int index ); 51 | bool GetStartPoint( MCAD_POINT& pt, bool xform = true ); 52 | bool GetEndPoint( MCAD_POINT& pt, bool xform = true ); 53 | int GetNSegments( void ); 54 | }; 55 | 56 | #endif // IGES_CURVE_H 57 | -------------------------------------------------------------------------------- /src/include/core/all_entities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: all_entities.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: list of headers for all implemented entities 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef ALL_ENTITIES_H 28 | #define ALL_ENTITIES_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | #endif // ALL_ENTITIES_H 58 | -------------------------------------------------------------------------------- /src/include/core/entity100.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity100.h 3 | * 4 | * This file is part of libIGES. 5 | * 6 | * libIGES is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libIGES is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, If not, see 18 | * or write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | /* 24 | * Description: IGES Entity 100: Circle, Section 4.3, p.66+ (94+) 25 | */ 26 | 27 | #ifndef ENTITY_100_H 28 | #define ENTITY_100_H 29 | 30 | #include 31 | #include 32 | 33 | // NOTE: 34 | // Arcs must lie in the Xt-Yt plane (constant Z in definition space coordinates). 35 | // Arcs are defined by their endpoints and center and are traced in a CCW fashion 36 | // from First Endpoint to Second Endpoint (similar to the IDF specification). 37 | // 38 | // The associated parameter data are: 39 | // + ZT: Real: Zt displacement of the arc from the Xt-Yt plane 40 | // + X1: Real: Arc center, abscissa 41 | // + Y1: Real: Arc center, ordinate 42 | // + X2: Real: Start point, abscissa 43 | // + Y2: Real: Start point, ordinate 44 | // + X3: Real: End point, abscissa 45 | // + Y3: Real: End point, ordinate 46 | // 47 | // Forms: 0 only 48 | // 49 | // Unused DE items: 50 | // + Structure 51 | // 52 | 53 | 54 | /** 55 | * Class IGES_ENTITY_100 56 | * represents a circle or a counterclockwise circular arc comprised of 57 | * a Z plane, center point and arc start and end points; a circle has 58 | * an end point which is the same as its start point. 59 | */ 60 | class IGES_ENTITY_100 : public IGES_CURVE 61 | { 62 | protected: 63 | 64 | friend class IGES; 65 | virtual bool format( int &index ); 66 | virtual bool rescale( double sf ); 67 | 68 | // parameters used in interpolations 69 | double radius; 70 | double startAng; // start angle 71 | double endAng; // terminate angle 72 | 73 | public: 74 | // public functions for internal libIGES use 75 | virtual bool associate(std::vector *entities); 76 | virtual bool unlink(IGES_ENTITY *aChild); 77 | virtual bool isOrphaned( void ); 78 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 79 | virtual bool delReference(IGES_ENTITY *aParentEntity); 80 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 81 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 82 | 83 | public: 84 | IGES_ENTITY_100( IGES* aParent ); 85 | virtual ~IGES_ENTITY_100(); 86 | 87 | // Inherited from IGES_CURVE 88 | virtual bool GetStartPoint( MCAD_POINT& pt, bool xform = true ); 89 | virtual bool GetEndPoint( MCAD_POINT& pt, bool xform = true ); 90 | 91 | virtual int GetNSegments( void ); 92 | virtual bool IsClosed( void ); 93 | virtual int GetNCurves( void ); 94 | virtual IGES_CURVE* GetCurve( int index ); 95 | 96 | // Inherited from IGES_ENTITY 97 | virtual bool SetEntityForm( int aForm ); 98 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 99 | 100 | /// Z plane of the circular arc 101 | union 102 | { 103 | double zOffset; // ZT in the IGES spec 104 | double ZT; 105 | }; 106 | 107 | /// X value, arc center 108 | union 109 | { 110 | double xCenter; // X1 111 | double X1; 112 | }; 113 | 114 | /// Y value, arc center 115 | union 116 | { 117 | double yCenter; // Y1 118 | double Y1; 119 | }; 120 | 121 | /// X value, arc start point 122 | union 123 | { 124 | double xStart; // X2 125 | double X2; 126 | }; 127 | 128 | /// Y value, arc start point 129 | union 130 | { 131 | double yStart; // Y2 132 | double Y2; 133 | }; 134 | 135 | /// X value, arc end point 136 | union 137 | { 138 | double xEnd; // X3 139 | double X3; 140 | }; 141 | 142 | /// X value, arc end point 143 | union 144 | { 145 | double yEnd; // Y3 146 | double Y3; 147 | }; 148 | }; 149 | 150 | #endif // ENTITY_100_H 151 | -------------------------------------------------------------------------------- /src/include/core/entity102.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity102.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 102: Composite Curve, Section 4.4, p.69+ (97+) 27 | */ 28 | 29 | #ifndef ENTITY_102_H 30 | #define ENTITY_102_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // 37 | // A Composite Curve is an ordered list of entities including Point, 38 | // Connect Point, and generic parameterized curves (except for Composite Curve itself). 39 | // The order of listing of member entities is the order in which they appear in 40 | // the parameter list. Acceptable entities include: 41 | // * 100 ENT_CIRCULAR_ARC 42 | // * 104 ENT_CONIC_ARC 43 | // * 110 ENT_LINE 44 | // * 112 ENT_PARAM_SPLINE_CURVE 45 | // * 116 *ENT_POINT 46 | // * 126 ENT_NURBS_CURVE 47 | // * 132 *ENT_CONNECT_POINT 48 | // * 106 ENT_COPIOUS_DATA FORMS: (Due to complexity, postpone any implementation of this) 49 | // * Note: not necessarily all forms are supported; this needs to be checked carefully 50 | // * 1, 2, 3 51 | // * 11, 12, 13 52 | // * 63 53 | // * 130 ENT_OFFSET_CURVE (Due to complexity, postpone this one) 54 | // 55 | // + Subordinate entities (items in the list) must have a physical dependence 56 | // relationship with this entity. The first point of this entity is the first 57 | // point of the first list entity and the last point of this entity is the 58 | // last point of the last list entity. Within the list, the last point of 59 | // entity N must be the same as the first point of entity N+1. 60 | // 61 | // + Note restrictions on the use of the Point and Connect Point Entities, p.69 (97) 62 | // 63 | // + When HIERARCHY is Global Defer, the following entries are ignored and may 64 | // be defaulted: 65 | // + Line Font Pattern 66 | // + Line Weight 67 | // + Color Number 68 | // + Level 69 | // + View 70 | // + Blank Status 71 | // 72 | // The associated parameter data are: 73 | // + N: Int: Number of member entities 74 | // + DE(1): Int: Index to DE of 1st member entity 75 | // + DE(N): Int: Index to DE of last member entity 76 | // 77 | // Forms: 0 only 78 | // 79 | // Unused DE items: 80 | // + Structure 81 | // 82 | 83 | 84 | /** 85 | * Class IGES_ENTITY_102 86 | * represents a composite curve comprised of a list of entities 87 | * of types 100 (circle), 104 (conic section), 110 (line). 88 | * 112 (parametric spline curve), 126 (spline curve), 89 | * 106[forms 1, 2, 3, 11, 12, 13, 63] (copious data), 90 | * or 130 (offset curve). In addition the list may contain points of 91 | * type 116 (point entity), or 132 (connect point entity). 92 | */ 93 | class IGES_ENTITY_102 : public IGES_CURVE 94 | { 95 | protected: 96 | 97 | friend class IGES; 98 | virtual bool format( int &index ); 99 | virtual bool rescale( double sf ); 100 | 101 | std::list iCurves; 102 | std::list curves; 103 | 104 | public: 105 | // public functions for libIGES only 106 | virtual bool associate(std::vector *entities); 107 | virtual bool unlink(IGES_ENTITY *aChild); 108 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 109 | virtual bool delReference(IGES_ENTITY *aParentEntity); 110 | virtual bool isOrphaned( void ); 111 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 112 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 113 | 114 | public: 115 | IGES_ENTITY_102( IGES* aParent ); 116 | virtual ~IGES_ENTITY_102(); 117 | 118 | // method for adding items to this compound curve 119 | bool AddSegment( IGES_CURVE* aSegment ); 120 | 121 | // Inherited virtual functions 122 | virtual bool SetEntityForm(int aForm); 123 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 124 | 125 | virtual bool IsClosed( void ); 126 | virtual int GetNCurves( void ); 127 | virtual IGES_CURVE* GetCurve( int index ); 128 | virtual bool GetStartPoint( MCAD_POINT& pt, bool xform = true ); 129 | virtual bool GetEndPoint( MCAD_POINT& pt, bool xform = true ); 130 | virtual int GetNSegments( void ); 131 | }; 132 | 133 | #endif // ENTITY_102_H 134 | -------------------------------------------------------------------------------- /src/include/core/entity104.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity104.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 104: Conic Arc, Section 4.5, p.74+ (102+) 27 | */ 28 | 29 | #ifndef ENTITY_104_H 30 | #define ENTITY_104_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // 37 | // A Conic Arc, like a Circle, is constrained to a plane parallel to Xt-Yt. 38 | // The curve is a subset of the general equation: 39 | // AX^2 + BXY + CY^2 + DX + EY + F = 0 40 | // The axis of the conic must be parallel to Xt or Yt; any other orientation 41 | // is achieved via the Transformation Matrix. Degenerate forms such as 42 | // Point and Line are prohibited. Form 0, allowed in previous versions of 43 | // the specification, is deprecated. 44 | // 45 | // The associated parameter data are: 46 | // + A: Real: Coefficient A 47 | // + B: Real: Coefficient A 48 | // + C: Real: Coefficient A 49 | // + D: Real: Coefficient A 50 | // + E: Real: Coefficient A 51 | // + F: Real: Coefficient A 52 | // + ZT: Real: Zt displacement of the arc from the Xt-Yt plane 53 | // + X1: Real: Start point, abscissa 54 | // + Y1: Real: Start point, ordinate 55 | // + X2: Real: End point, abscissa 56 | // + Y2: Real: End point, ordinate 57 | // 58 | // Forms: (note: Form 0 does not exist) 59 | // 1: ellipse 60 | // 2: hyperbola 61 | // 3: parabola 62 | // 63 | // Unused DE items: 64 | // + Structure 65 | // 66 | 67 | 68 | /** 69 | * Class IGES_ENTITY_104 70 | * represents a general parameterized conic section 71 | */ 72 | class IGES_ENTITY_104 : public IGES_CURVE 73 | { 74 | private: 75 | int getForm(); 76 | 77 | protected: 78 | 79 | friend class IGES; 80 | virtual bool format( int &index ); 81 | virtual bool rescale( double sf ); 82 | 83 | public: 84 | // public functions for libIGES only 85 | virtual bool associate(std::vector *entities); 86 | virtual bool unlink(IGES_ENTITY *aChild); 87 | virtual bool isOrphaned( void ); 88 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 89 | virtual bool delReference(IGES_ENTITY *aParentEntity); 90 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 91 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 92 | 93 | public: 94 | IGES_ENTITY_104( IGES* aParent ); 95 | virtual ~IGES_ENTITY_104(); 96 | 97 | // public variables 98 | double A; //< 1st general conic parameter 99 | double B; //< 2nd general conic parameter 100 | double C; //< 3rd general conic parameter 101 | double D; //< 4th general conic parameter 102 | double E; //< 5th general conic parameter 103 | double F; //< 6th general conic parameter 104 | double ZT; //< Z coordinate of plane in which conic is defined 105 | double X1; //< X value, start point, abscissa 106 | double Y1; //< Y value, start point, abscissa 107 | double X2; //< X value, terminal point, abscissa 108 | double Y2; //< Y value, terminal point, abscissa 109 | 110 | // Inherited from IGES_ENTITY 111 | virtual bool SetEntityForm(int aForm); 112 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 113 | 114 | // Inherited from IGES_CURVE 115 | virtual bool GetStartPoint( MCAD_POINT& pt, bool xform = true ); 116 | virtual bool GetEndPoint( MCAD_POINT& pt, bool xform = true ); 117 | virtual int GetNSegments( void ); 118 | virtual bool IsClosed( void ); 119 | virtual int GetNCurves( void ); 120 | virtual IGES_CURVE* GetCurve( int index ); 121 | }; 122 | 123 | #endif // ENTITY_104_H 124 | -------------------------------------------------------------------------------- /src/include/core/entity108.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity108.h 3 | * 4 | * This file is part of libIGES. 5 | * 6 | * libIGES is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libIGES is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, If not, see 18 | * or write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | /* 24 | * Description: IGES Entity 108: Plane Entity, Section 4.12, p.92+ (120+) 25 | */ 26 | 27 | #ifndef ENTITY_108_H 28 | #define ENTITY_108_H 29 | 30 | #include 31 | #include 32 | 33 | // NOTE: 34 | // Planes are parameterized in definition space coordinates as A*Xt + B*Yt + C*Zt = D. 35 | // A plane may be unbounded (Type 0), bounded (Type 1); or (deprecated) a bounded plane 36 | // representing a hole (Type -1). 37 | // Display symbols are supported by parameters 6 to 9. 38 | // 39 | // The associated parameter data are: 40 | // + A : Real : Xt coefficient of the plane 41 | // + B : Real : Yt coefficient of the plane 42 | // + C : Real : Zt coefficient of the plane 43 | // + D : Real : coefficient of the plane 44 | // + PTR : Pointer : always zero 45 | // + X : Real : Xt coordinate of display symbol 46 | // + Y : Real : Yt coordinate of display symbol 47 | // + Z : Real : Zt coordinate of display symbol 48 | // + SIZE: Real : size parameter for display symbol 49 | // 50 | // Forms: 51 | // -1 : (deprecated) bounded plane representing a hole 52 | // 0 : unbounded plane 53 | // 1 : bounded plane 54 | // 55 | // Unused DE items: 56 | // + Structure 57 | // + Line Font Pattern 58 | // + Line Weight Number 59 | // 60 | // Special notes: 61 | // If the plane is used as a clipping plane then Entity use Flag shall be of type Annotation (01) 62 | // 63 | 64 | 65 | /** 66 | * Class IGES_ENTITY_108 67 | * represents a plane as A*Xt + B*Yt + C*Zt = D. 68 | */ 69 | class IGES_ENTITY_108 : public IGES_ENTITY 70 | { 71 | protected: 72 | 73 | friend class IGES; 74 | virtual bool format( int &index ); 75 | virtual bool rescale( double sf ); 76 | 77 | // Type 108 parameters 78 | IGES_CURVE* PTR; //< closed curve referenced by iPtr 79 | int iPtr; //< DE Sequence of the planar curve 80 | 81 | public: 82 | // public functions for internal libIGES use 83 | virtual bool associate(std::vector *entities); 84 | virtual bool unlink(IGES_ENTITY *aChild); 85 | virtual bool isOrphaned( void ); 86 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 87 | virtual bool delReference(IGES_ENTITY *aParentEntity); 88 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 89 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 90 | 91 | public: 92 | IGES_ENTITY_108( IGES* aParent ); 93 | virtual ~IGES_ENTITY_108(); 94 | 95 | // Inherited virtual functions 96 | virtual bool SetEntityForm( int aForm ); 97 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 98 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 99 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 100 | 101 | // other virtuals to be overridden 102 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 103 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 104 | virtual bool SetLineWeightNum( int aLineWeight ); 105 | 106 | // Type 108 functions 107 | /** 108 | * Function GetClosedCurve 109 | * retrieves a pointer to the (planar) closed bounding curve. 110 | * 111 | * @param aCurve = handle to to store the reference to the closed curve 112 | */ 113 | bool GetClosedCurve( IGES_CURVE** aCurve ); 114 | 115 | /** 116 | * Function SetClosedCurve 117 | * sets the closed planar bounding curve and returns true on success. 118 | * 119 | * @param aCurve = pointer to the closed planar curve to be extruded 120 | */ 121 | bool SetClosedCurve( IGES_CURVE* aCurve ); 122 | 123 | // Type 108 parameters 124 | double A; //< Plane coefficient A*Xt 125 | double B; //< Plane coefficient B*Yt 126 | double C; //< Plane coefficient C*Zt 127 | double D; //< Plane coefficient D 128 | 129 | double X; //< X coordinate of display symbol 130 | double Y; //< X coordinate of display symbol 131 | double Z; //< X coordinate of display symbol 132 | double Size; //< X size parameter of display symbol 133 | }; 134 | 135 | #endif // ENTITY_108_H 136 | -------------------------------------------------------------------------------- /src/include/core/entity110.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity110.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 110: Line, Section 4.13, p.96+ (124+) 27 | */ 28 | 29 | #ifndef ENTITY_110_H 30 | #define ENTITY_110_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // The associated parameter data are: 37 | // + X1: Real: Start point 38 | // + Y1: Real: Start point 39 | // + Z1: Real: Start point 40 | // + X2: Real: End point 41 | // + Y2: Real: End point 42 | // + Z2: Real: End point 43 | // 44 | // Forms: 45 | // 0: line from Xt(1),Yt(1),Zt(1) to Xt(2),Yt(2),Zt(2) 46 | // 1: semi-bounded (has origin at P1 but no terminus) 47 | // 2: unbounded (infinite line for drawing) 48 | // The difference in the forms lies in the imposed limitations 49 | // on the parameterization variable (0..1, 0..+inf, -inf..+inf) 50 | // 51 | // Unused DE items: 52 | // + Structure 53 | // 54 | 55 | 56 | /** 57 | * Class IGES_ENTITY_110 58 | * represents a line segment, ray, or line 59 | */ 60 | class IGES_ENTITY_110 : public IGES_CURVE 61 | { 62 | protected: 63 | 64 | friend class IGES; 65 | virtual bool format( int &index ); 66 | virtual bool rescale( double sf ); 67 | 68 | public: 69 | // public functions for libIGES only 70 | virtual bool associate(std::vector *entities); 71 | virtual bool unlink(IGES_ENTITY *aChild); 72 | virtual bool isOrphaned( void ); 73 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 74 | virtual bool delReference(IGES_ENTITY *aParentEntity); 75 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 76 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 77 | 78 | public: 79 | IGES_ENTITY_110( IGES* aParent ); 80 | virtual ~IGES_ENTITY_110(); 81 | 82 | // Inherited virtual functions 83 | virtual bool SetEntityForm(int aForm); 84 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 85 | 86 | double X1; // X value, start point 87 | double Y1; // Y value, start point 88 | double Z1; // Z value, start point 89 | double X2; // X value, end point 90 | double Y2; // Y value, end point 91 | double Z2; // Z value, end point 92 | 93 | // methods required of parameterized curve entities 94 | virtual bool GetStartPoint( MCAD_POINT& pt, bool xform = true ); 95 | virtual bool GetEndPoint( MCAD_POINT& pt, bool xform = true ); 96 | virtual int GetNSegments( void ); 97 | virtual bool IsClosed( void ); 98 | virtual int GetNCurves( void ); 99 | virtual IGES_CURVE* GetCurve( int index ); 100 | }; 101 | 102 | #endif // ENTITY_110_H 103 | -------------------------------------------------------------------------------- /src/include/core/entity122.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity122.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 122: Tabulated Cylinder, Section 4.19, p.119(147+) 27 | */ 28 | 29 | #ifndef ENTITY_122_H 30 | #define ENTITY_122_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | // Note: 37 | // The associated parameter data are: 38 | // + DE: Int: pointer to DE entry of directrix 39 | // + LX: Real: coordinates of terminate point of generatrix 40 | // + LY: Real 41 | // + LZ: Real 42 | // 43 | // Forms: 0 44 | // 45 | // Unused DE items: 46 | // + Structure 47 | // 48 | 49 | 50 | /** 51 | * Class IGES_ENTITY_122 52 | * represents a Tabulated Cylinder which consists of a line segment, 53 | * the generatrix, which is swept along a 2D or 3D curve, the 54 | * directrix. The implied start point of the generatrix is the start 55 | * point of the directrix. 56 | */ 57 | class IGES_ENTITY_122 : public IGES_ENTITY 58 | { 59 | protected: 60 | 61 | friend class IGES; 62 | virtual bool format( int &index ); 63 | virtual bool rescale( double sf ); 64 | 65 | IGES_CURVE* DE; 66 | int iDE; 67 | 68 | public: 69 | // public functions for libIGES only 70 | virtual bool associate(std::vector *entities); 71 | virtual bool unlink(IGES_ENTITY *aChild); 72 | virtual bool isOrphaned( void ); 73 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 74 | virtual bool delReference(IGES_ENTITY *aParentEntity); 75 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 76 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 77 | 78 | public: 79 | IGES_ENTITY_122( IGES* aParent ); 80 | virtual ~IGES_ENTITY_122(); 81 | 82 | // Inherited virtual functions 83 | virtual bool SetEntityForm(int aForm); 84 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 85 | 86 | // parameters 87 | double LX; //< X value of Generatrix end point 88 | double LY; //< Y value of Generatrix end point 89 | double LZ; //< Z value of Generatrix end point 90 | 91 | /** 92 | * Function GetDE 93 | * retrieves a pointer to the Directrix Entity 2D/3D curve 94 | * and returns true on success. 95 | * 96 | * @param aPtr = pointer to store a pointer to the directrix curve 97 | */ 98 | bool GetDE( IGES_CURVE*& aPtr ); 99 | 100 | /** 101 | * Function SetDE 102 | * sets the curve entity of the Directrix and returns true on success. 103 | * 104 | * @param aPtr = pointer to the Directrix curve 105 | */ 106 | bool SetDE( IGES_CURVE* aPtr ); 107 | }; 108 | 109 | #endif // ENTITY_122_H 110 | -------------------------------------------------------------------------------- /src/include/core/entity124.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity124.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 124: Transformation Matrix, Section 4.21, p.123+ (151+) 27 | */ 28 | 29 | #ifndef ENTITY_124_H 30 | #define ENTITY_124_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | // NOTE: 37 | // The associated parameter data are: 38 | // + R11: Real: Top Row 39 | // + R12: Real: 40 | // + R13: Real: 41 | // + T1: Real: 42 | // + R21: Real: Second Row 43 | // + R22: Real: 44 | // + R23: Real: 45 | // + T2: Real: 46 | // + R21: Real: Third Row 47 | // + R22: Real: 48 | // + R23: Real: 49 | // + T2: Real: 50 | // 51 | // Forms: 52 | // 0: Matrix is Orthonormal and with a Determinant of 1; output will be in a Right-Hand Coordinate System 53 | // 1: Matrix is Orthonormal and with a Determinant of -1; output will be in a Left-Hand Coordinate System 54 | // 10, 11, 12: For Finite Element Analysis only 55 | // 56 | // Unused DE items: 57 | // + Structure 58 | // + Line Font Pattern 59 | // + Level 60 | // + View 61 | // + Label Display Association 62 | // + Line weight 63 | // + Color number 64 | // 65 | // Since transforms may be nested we should provide the following operators for access: 66 | // Set/GetChildTransform(): Sets/gets the child transform in the DE 67 | // Set/GetTopTransform(): Sets/gets this entity's transform data 68 | // GetTransformMatrix(): Gets the overall transform matrix 69 | // Transform(X,Y,Z): Performs a transform on the given point 70 | // 71 | // Note that GetTransformMatrix() produces the matrix by combining the 72 | // Top matrix with the child's GetTransformMatrix(). This ensures correct 73 | // application of all subordinate transforms. 74 | // 75 | 76 | 77 | /** 78 | * Class IGES_ENTITY_124 79 | * represents a Transformation which consists of a 80 | * 3x3 Transformation Matrix and a 3x1 Offset Matrix. 81 | */ 82 | class IGES_ENTITY_124 : public IGES_ENTITY 83 | { 84 | protected: 85 | 86 | friend class IGES; 87 | virtual bool format( int &index ); 88 | virtual bool rescale( double sf ); 89 | 90 | public: 91 | // public functions for libIGES only 92 | virtual bool associate(std::vector *entities); 93 | virtual bool unlink(IGES_ENTITY *aChild); 94 | virtual bool isOrphaned( void ); 95 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 96 | virtual bool delReference(IGES_ENTITY *aParentEntity); 97 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 98 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 99 | 100 | public: 101 | MCAD_TRANSFORM T; //< Transformation matrix data for this entity 102 | 103 | IGES_ENTITY_124( IGES* aParent ); 104 | virtual ~IGES_ENTITY_124(); 105 | 106 | // Inherited virtual functions 107 | virtual bool SetEntityForm(int aForm); 108 | virtual bool SetVisibility(bool isVisible); 109 | virtual bool SetDependency(IGES_STAT_DEPENDS aDependency); 110 | virtual bool SetEntityUse(IGES_STAT_USE aUseCase); 111 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 112 | 113 | // items to be overridden; these items are not supported in this entity 114 | // + Line Font Pattern 115 | // + Level 116 | // + View 117 | // + Label Display Association 118 | // + Line weight 119 | // + Color number 120 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 121 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 122 | virtual bool SetLevel( int aLevel ); 123 | virtual bool SetLevel( IGES_ENTITY* aLevel ); 124 | virtual bool SetView( IGES_ENTITY* aView ); 125 | virtual bool SetLabelAssoc( IGES_ENTITY* aLabelAssoc ); 126 | virtual bool SetColor( IGES_COLOR aColor ); 127 | virtual bool SetColor( IGES_ENTITY* aColor ); 128 | virtual bool SetLineWeightNum( int aLineWeight ); 129 | 130 | /** 131 | * Function GetTransformMatrix 132 | * returns the overall transformation matrix for this entity 133 | * which is equal to the local transform data multiplied by the 134 | * overall transformation matrix of the referenced transform 135 | * entity if any. 136 | */ 137 | MCAD_TRANSFORM GetTransformMatrix( void ); 138 | }; 139 | 140 | #endif // ENTITY_124_H 141 | -------------------------------------------------------------------------------- /src/include/core/entity154.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity154.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 154: Right Circular Cylinder, Section 4.39, p.193(221+) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef ENTITY_154_H 28 | #define ENTITY_154_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | // Note: 35 | // The associated parameter data are: 36 | // + H: Real: Cylinder Height 37 | // + R: Real: Cylinder Radius 38 | // + X1: Real: First face center coordinates 39 | // + Y1: Real: 40 | // + Z1: Real: 41 | // + I1: Real: Unit vector in axis direction 42 | // + J1: Real: 43 | // + K1: Real: 44 | // 45 | // Forms: 0 46 | // 47 | // Unused DE items: 48 | // + Structure 49 | // 50 | 51 | 52 | /** 53 | * Class IGES_ENTITY_154 54 | * represents a Right Circular Cylinder 55 | */ 56 | class IGES_ENTITY_154 : public IGES_ENTITY 57 | { 58 | protected: 59 | 60 | friend class IGES; 61 | virtual bool format( int &index ); 62 | virtual bool rescale( double sf ); 63 | 64 | public: 65 | // public functions for libIGES only 66 | virtual bool associate(std::vector *entities); 67 | virtual bool unlink(IGES_ENTITY *aChild); 68 | virtual bool isOrphaned( void ); 69 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 70 | virtual bool delReference(IGES_ENTITY *aParentEntity); 71 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 72 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 73 | 74 | public: 75 | IGES_ENTITY_154( IGES* aParent ); 76 | virtual ~IGES_ENTITY_154(); 77 | 78 | // Inherited virtual functions 79 | virtual bool SetEntityForm( int aForm ); 80 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 81 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 82 | 83 | // parameters 84 | double H; //< cylinder height 85 | double R; //< cylinder radius 86 | double X1; //< X value, first face center coordinate, default 0 87 | double Y1; //< Y value, first face center coordinate, default 0 88 | double Z1; //< Z value, first face center coordinate, default 0 89 | double I1; //< X value, unit vector in axis direction, default 0 90 | double J1; //< Y value, unit vector in axis direction, default 0 91 | double K1; //< Z value, unit vector in axis direction, default 1 92 | }; 93 | 94 | #endif // ENTITY_154_H 95 | -------------------------------------------------------------------------------- /src/include/core/entity164.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity164.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 164: Solid of Linear Extrusion, Section 4.44, p.204(232+) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef ENTITY_164_H 28 | #define ENTITY_164_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | // NOTE: 35 | // The associated parameter data are: 36 | // + PTR: Index: DE of closed planar curve 37 | // + L: Real: Length of extrusion along positive vector direction 38 | // + I1: Real: Unit vector in extrusion direction 39 | // + J1: Real: 40 | // + K1: Real: 41 | // 42 | // Forms: 0 43 | // 44 | // Unused DE items: 45 | // + Structure 46 | // 47 | 48 | 49 | /** 50 | * Class IGES_ENTITY_164 51 | * represents a Solid of Linear Extrusion 52 | */ 53 | class IGES_ENTITY_164 : public IGES_ENTITY 54 | { 55 | protected: 56 | 57 | friend class IGES; 58 | virtual bool format( int &index ); 59 | virtual bool rescale( double sf ); 60 | 61 | IGES_CURVE* PTR; // closed curve 62 | 63 | public: 64 | // public functions for libIGES only 65 | virtual bool associate(std::vector *entities); 66 | virtual bool unlink(IGES_ENTITY *aChild); 67 | virtual bool isOrphaned( void ); 68 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 69 | virtual bool delReference(IGES_ENTITY *aParentEntity); 70 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 71 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 72 | 73 | public: 74 | IGES_ENTITY_164( IGES* aParent ); 75 | virtual ~IGES_ENTITY_164(); 76 | 77 | // Inherited virtual functions 78 | virtual bool SetEntityForm(int aForm); 79 | virtual bool SetEntityUse(IGES_STAT_USE aUseCase); 80 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 81 | 82 | /** 83 | * Function GetClosedCurve 84 | * retrieves a pointer to the (planar) closed curve to be extruded 85 | * and returns true if a closed curve had been specified. 86 | * 87 | * @param aCurve = handle to to store the reference to the closed curve 88 | */ 89 | bool GetClosedCurve( IGES_CURVE** aCurve ); 90 | 91 | /** 92 | * Function SetClosedCurve 93 | * sets the closed planar curve which is to be extruded and returns 94 | * true on success. 95 | * 96 | * @param aCurve = pointer to the closed planar curve to be extruded 97 | */ 98 | bool SetClosedCurve( IGES_CURVE* aCurve ); 99 | 100 | int iPtr; //< DE Sequence of the planar curve 101 | double L; //< length of extrusion 102 | double I1; //< X unit vector of direction; default 0 103 | double J1; //< Y unit vector of direction; default 0 104 | double K1; //< Z unit vector of direction; default 1 105 | }; 106 | 107 | #endif // ENTITY_164_H 108 | -------------------------------------------------------------------------------- /src/include/core/entity180.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity180.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 180: Boolean Tree, Section 4.46, p.209(237+) 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef ENTITY_180_H 28 | #define ENTITY_180_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | // NOTE: 35 | // The boolean operators are in Postfix Notation. Examples: 36 | // + DE1, DE2, DIFFERENCE, 37 | // + DE1, DE2, DIFFERENCE, DE3, DIFFERENCE, DE4, DIFFERENCE (A board with holes can be built this way) 38 | // Since the operators are BOOLEAN, if M is the number of Operands, the number of Operators must be M - 1. 39 | // The specification implies a stack of operands and operators; it should be possible to parse these into 40 | // a list of some sort. 41 | // 42 | // The associated parameter data are: 43 | // + N: Number: Number of items (DE pointers + Operators) 44 | // + LIST: List of DEs (negative) and Operators (1:Union, 2:Intersection, 3:Difference) 45 | // 46 | // Forms: 47 | // 0: All operands are Primitives, Solid Instances, or other Boolean Trees 48 | // 1: At least one operand is a Manifold BREP Object 49 | // 50 | // Unused DE items: 51 | // + Structure 52 | // 53 | // Access functions: 54 | // Use Push(pointer/integer) and Pop() to manipulate the list; provide an iterator. 55 | // The Push(pointer) function must check the type of data pushed and change the Form 56 | // to 1 if necessary. 57 | // 58 | 59 | 60 | /** 61 | * Class IGES_ENTITY_180 62 | * represents a Boolean Solid Operation Tree. 63 | */ 64 | class IGES_ENTITY_180 : public IGES_ENTITY 65 | { 66 | protected: 67 | 68 | friend class IGES; 69 | virtual bool format( int &index ); 70 | virtual bool rescale( double sf ); 71 | 72 | std::list nodes; 73 | bool typeOK( int aTypeNum ); 74 | 75 | public: 76 | // public functions for libIGES only 77 | virtual bool associate(std::vector *entities); 78 | virtual bool unlink(IGES_ENTITY *aChild); 79 | virtual bool isOrphaned( void ); 80 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 81 | virtual bool delReference(IGES_ENTITY *aParentEntity); 82 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 83 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 84 | 85 | public: 86 | IGES_ENTITY_180( IGES* aParent ); 87 | virtual ~IGES_ENTITY_180(); 88 | 89 | // Inherited virtual functions 90 | virtual bool SetEntityForm(int aForm); 91 | virtual bool SetDependency(IGES_STAT_DEPENDS aDependency); 92 | virtual bool SetEntityUse(IGES_STAT_USE aUseCase); 93 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 94 | 95 | /** 96 | * Function AddOp 97 | * adds the given operator to the list of entities in the boolean tree 98 | * 99 | * @param op = Boolean Operation 100 | */ 101 | bool AddOp( BTREE_OPERATOR op ); 102 | 103 | /** 104 | * Function AddArg 105 | * adds the given argument to the list of entities in the boolean tree 106 | * 107 | * @param aOperand = operand for the Boolean Tree 108 | */ 109 | bool AddArg( IGES_ENTITY* aOperand ); 110 | 111 | /** 112 | * Function ClearNodes 113 | * erases the current Boolean Tree operator/operand list 114 | */ 115 | void ClearNodes( void ); 116 | 117 | /** 118 | * Function GetNNodes 119 | * returns the number of nodes (operators and operands) in the BTREE list 120 | */ 121 | int GetNNodes( void ); 122 | 123 | /** 124 | * Function GetNodes 125 | * returns a pointer to the internal list of BTREE operators and operands 126 | */ 127 | BTREE_NODE* GetNode( int aIndex ); 128 | }; 129 | 130 | #endif // ENTITY_180_H 131 | -------------------------------------------------------------------------------- /src/include/core/entity184.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity184.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 184: Solid Assembly, Section 4.48 p.214/242 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef ENTITY_184_H 28 | #define ENTITY_184_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | // NOTE: 35 | // Allowed entities: 36 | // + Primitive 37 | // + Boolean Tree 38 | // + Solid Assembly 39 | // + Solid Instance 40 | // + Manifold Solid B-Rep Object 41 | // 42 | // The associated parameter data are: 43 | // + PTR: Index: DE of the entity to be instantiated 44 | // 45 | // Forms: 46 | // 0: All items are one of Primitive, Solid Instance, Boolean Tree, or Solid Assembly 47 | // 1: At least one item is a Manifold BREP Object 48 | // 49 | // Unused DE items: 50 | // + Structure 51 | // 52 | 53 | 54 | /** 55 | * Class IGES_ENTITY_184 56 | * represents a Solid Assembly. 57 | */ 58 | class IGES_ENTITY_184 : public IGES_ENTITY 59 | { 60 | protected: 61 | 62 | friend class IGES; 63 | virtual bool format( int &index ); 64 | virtual bool rescale( double sf ); 65 | // XXX - TO BE IMPLEMENTED 66 | 67 | public: 68 | // public functions for libIGES only 69 | virtual bool associate(std::vector *entities); 70 | virtual bool unlink(IGES_ENTITY *aChild); 71 | virtual bool isOrphaned( void ); 72 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 73 | virtual bool delReference(IGES_ENTITY *aParentEntity); 74 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 75 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 76 | 77 | public: 78 | // Inherited virtual functions 79 | virtual void Compact( void ); 80 | virtual bool SetEntityForm(int aForm); 81 | virtual bool SetDependency(IGES_STAT_DEPENDS aDependency); 82 | virtual bool SetEntityUse(IGES_STAT_USE aUseCase); 83 | virtual bool SetHierarchy(IGES_STAT_HIER aHierarchy); 84 | 85 | // XXX - TO BE IMPLEMENTED 86 | 87 | }; 88 | 89 | #endif // ENTITY_430_H 90 | -------------------------------------------------------------------------------- /src/include/core/entity186.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity186.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: IGES Entity 186: Manifold Solid B-REP Object (MSBO) 7 | * Section 4.49, p.216+ (244+) 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | #ifndef ENTITY_186_H 29 | #define ENTITY_186_H 30 | 31 | #include 32 | #include 33 | 34 | // NOTE: 35 | // The associated parameter data are: 36 | // + SHELL: INT: DE of the shell 37 | // + SOF: BOOL: Orientation flag of shell, 1 = agrees with underlying faces 38 | // + N: INT: number of void shells or 0 39 | // + VOID(n): INT: DE to void shell 40 | // + VOF(n): BOOL: orientation flag of void shell 41 | // Form: 0 42 | // 43 | // Unused DE items: 44 | // + Structure 45 | 46 | class IGES_ENTITY_514; 47 | 48 | /** 49 | * Class IGES_ENTITY_186 50 | * represents a Manifold Solid B-Rep Object (MSBO) 51 | */ 52 | class IGES_ENTITY_186 : public IGES_ENTITY 53 | { 54 | protected: 55 | friend class IGES; 56 | virtual bool format( int &index ); 57 | virtual bool rescale( double sf ); 58 | 59 | int mDEshell; //< DE of the shell 60 | IGES_ENTITY_514* mshell; //< the primary shell of this MSBO 61 | bool mSOF; //< shell orientation flag 62 | std::list > ivoids; //< DE of voids and their Orientation Flag 63 | std::list > mvoids; //< voids and their Orientation Flag 64 | 65 | public: 66 | // public functions for libIGES only 67 | virtual bool associate(std::vector *entities); 68 | virtual bool unlink(IGES_ENTITY *aChild); 69 | virtual bool isOrphaned( void ); 70 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 71 | virtual bool delReference(IGES_ENTITY *aParentEntity); 72 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 73 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 74 | 75 | public: 76 | IGES_ENTITY_186( IGES* aParent ); 77 | virtual ~IGES_ENTITY_186(); 78 | 79 | // Inherited virtual functions 80 | virtual bool SetEntityForm( int aForm ); 81 | 82 | // functions unique to E186 83 | // XXX - TO BE IMPLEMENTED 84 | }; 85 | 86 | #endif // ENTITY_186_H 87 | -------------------------------------------------------------------------------- /src/include/core/entity314.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity314.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 314: Color, Section 4.77, p.386 (414) 27 | */ 28 | 29 | #ifndef ENTITY314_H 30 | #define ENTITY314_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // The associated parameter data are: 37 | // + red: Real: Red, 0.0 .. 100.0 38 | // + grn: Real: Green 39 | // + blu: Real: Blue 40 | // + cname: STR: Color name (optional) 41 | // 42 | // Forms: 0 only 43 | // 44 | // Unused DE items: 45 | // + Structure 46 | // + Line Font Pattern 47 | // + Level 48 | // + View 49 | // + Transform 50 | // + Label Display Association 51 | // + Line weight 52 | // 53 | // Constraints: 54 | // COLOR DE item must be 1..8 to represent the closest predefined shade 55 | 56 | 57 | /** 58 | * Class IGES_ENTITY_314 59 | * represents the Color Definition Entity; this entity can 60 | * be used to define colors which are not predefined by the 61 | * IGES specification. Note that to conform to the specification 62 | * the user must also invoke the function SetColor() to assign 63 | * a fixed color definition which most closely matches this 64 | * color. 65 | */ 66 | class IGES_ENTITY_314 : public IGES_ENTITY 67 | { 68 | protected: 69 | 70 | friend class IGES; 71 | virtual bool format( int &index ); 72 | virtual bool rescale( double sf ); 73 | 74 | public: 75 | // public functions for libIGES only 76 | virtual bool associate(std::vector *entities); 77 | virtual bool unlink(IGES_ENTITY *aChild); 78 | virtual bool isOrphaned( void ); 79 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 80 | virtual bool delReference(IGES_ENTITY *aParentEntity); 81 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 82 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 83 | 84 | public: 85 | IGES_ENTITY_314( IGES* aParent ); 86 | virtual ~IGES_ENTITY_314(); 87 | 88 | // Inherited virtual functions 89 | virtual bool SetEntityForm( int aForm ); 90 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 91 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 92 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 93 | 94 | // other virtuals to be overridden 95 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 96 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 97 | virtual bool SetLevel( int aLevel ); 98 | virtual bool SetLevel( IGES_ENTITY* aLevel ); 99 | virtual bool SetView( IGES_ENTITY* aView ); 100 | virtual bool SetTransform( IGES_ENTITY* aTransform ); 101 | virtual bool SetLabelAssoc( IGES_ENTITY* aLabelAssoc ); 102 | virtual bool SetColor( IGES_COLOR aColor ); 103 | virtual bool SetColor( IGES_ENTITY* aColor ); 104 | virtual bool SetVisibility(bool isVisible); 105 | virtual bool SetLineWeightNum( int aLineWeight ); 106 | 107 | // parameters 108 | union 109 | { 110 | double red; //< RED value (0..100); known in the specification as CC1 111 | double CC1; 112 | }; 113 | 114 | union 115 | { 116 | double green; //< GREEN value (0..100); known in the specification as CC2 117 | double CC2; 118 | }; 119 | 120 | union 121 | { 122 | double blue; //< BLUE value (0..100); known in the specification as CC3 123 | double CC3; 124 | }; 125 | 126 | std::string cname; // optional name describing the color; known in specification as CNAME 127 | std::string& CNAME; 128 | }; 129 | 130 | #endif // ENTITY314_H 131 | -------------------------------------------------------------------------------- /src/include/core/entity408.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity408.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 4-8: Subfigure Instance, Section 4.137, p.557(585+) 27 | */ 28 | 29 | #ifndef ENTITY_408_H 30 | #define ENTITY_408_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | class IGES_ENTITY_308; 37 | 38 | // Note: 39 | // The associated parameter data are: 40 | // + DE: Int: pointer to Entity308 (Subfigure Definition) 41 | // + X: Real: offset 42 | // + Y: Real 43 | // + Z: Real 44 | // + S: Real: scale factor, DEFAULT = 1.0 45 | // 46 | // Forms: 0 47 | // 48 | // Unused DE items: 49 | // + Structure 50 | // 51 | 52 | /** 53 | * Class IGES_ENTITY_408 54 | * represents the Singular Subfigure Instance Entity; this 55 | * entity is commonly used to instantiate a feature or part 56 | * within a part or subassembly. 57 | */ 58 | class IGES_ENTITY_408 : public IGES_ENTITY 59 | { 60 | protected: 61 | 62 | friend class IGES; 63 | virtual bool format( int &index ); 64 | virtual bool rescale( double sf ); 65 | 66 | IGES_ENTITY_308* DE; // Pointer to the Subfigure Definition Entity to be instantiated 67 | int iDE; // Directory Entry index to the Subfigure Definition Entity 68 | 69 | public: 70 | // public functions for libIGES only 71 | virtual bool associate(std::vector *entities); 72 | virtual bool unlink(IGES_ENTITY *aChild); 73 | virtual bool isOrphaned( void ); 74 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 75 | virtual bool delReference(IGES_ENTITY *aParentEntity); 76 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 77 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 78 | 79 | public: 80 | IGES_ENTITY_408( IGES* aParent ); 81 | virtual ~IGES_ENTITY_408(); 82 | 83 | // Inherited virtual functions 84 | virtual bool SetEntityForm( int aForm ); 85 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 86 | 87 | // parameters 88 | double X; //< X translation relative to type space of a referring entity 89 | double Y; //< Y translation relative to type space of a referring entity 90 | double Z; //< Z translation relative to type space of a referring entity 91 | double S; //< scale factor relative to type space of a referring entity 92 | 93 | 94 | /** 95 | * Function GetDE 96 | * retrieves a pointer to the associated Subfigure Definition Entity 97 | * and returns true on success; false is returned if there is no 98 | * associated Subfigure Definition Entity. 99 | * 100 | * @param aPtr = handle to store pointer to associated Subfigure Definition Entity 101 | */ 102 | bool GetDE( IGES_ENTITY_308*& aPtr ); 103 | 104 | 105 | /** 106 | * Function SetDE 107 | * sets the associated Subfigure Definition Entity and returns true on 108 | * success. 109 | * 110 | * @param aPtr = pointer to the Subfigure Definition Entity to associate 111 | */ 112 | bool SetDE( IGES_ENTITY_308* aPtr ); 113 | 114 | /** 115 | * Function GetDepthLevel 116 | * returns the nesting level of this entity; this function is used to 117 | * establish correct Depth Level values as per the IGES specification. 118 | */ 119 | int getDepthLevel( void ); 120 | }; 121 | 122 | #endif // ENTITY_408_H 123 | -------------------------------------------------------------------------------- /src/include/core/entity430.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity430.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 430: Solid Instance Entity, Section 4.146 p.584/612+ 27 | */ 28 | 29 | #ifndef ENTITY_430_H 30 | #define ENTITY_430_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | // NOTE: 37 | // Allowed entities: 38 | // + Primitive 39 | // + Boolean Tree 40 | // + Solid Assembly 41 | // + Solid Instance 42 | // + Manifold Solid B-Rep Object 43 | // 44 | // Entity Use Flag: 02 45 | // 46 | // The associated parameter data are: 47 | // + N: Integer: Number of paired items in list 48 | // + PTR(1) .. PTR(N): DE 49 | // + PTRM(1) .. PTRM(N): Transform Matrix for DE(x) 50 | // 51 | // Forms: 52 | // 0: The referenced solid is a Primitive, Solid Instance, Boolean Tree, or Solid Assembly 53 | // 1: The referenced solid is a Manifold BREP Object 54 | // 55 | // Unused DE items: 56 | // + Structure 57 | // 58 | 59 | 60 | /** 61 | * Class IGES_ENTITY_430 62 | * represents the Solid Instance Entity; this entity represents a single instance of 63 | * a feature, part, or subassembly. Note: This class is currently unimplemented; 64 | * implementation is contingent upon encountering IGES files which make use of this 65 | * entity. 66 | */ 67 | class IGES_ENTITY_430 : public IGES_ENTITY 68 | { 69 | protected: 70 | 71 | friend class IGES; 72 | virtual bool format( int &index ); 73 | virtual bool rescale( double sf ); 74 | // XXX - TO BE IMPLEMENTED 75 | 76 | public: 77 | // public functions for libIGES only 78 | virtual bool associate(std::vector *entities); 79 | virtual bool unlink(IGES_ENTITY *aChild); 80 | virtual bool isOrphaned( void ); 81 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 82 | virtual bool delReference(IGES_ENTITY *aParentEntity); 83 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 84 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 85 | 86 | public: 87 | // Inherited virtual functions 88 | virtual void Compact( void ); 89 | virtual bool SetEntityForm( int aForm ); 90 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 91 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 92 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 93 | 94 | // XXX - TO BE IMPLEMENTED 95 | 96 | }; 97 | 98 | #endif // ENTITY_430_H 99 | -------------------------------------------------------------------------------- /src/include/core/entity502.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity502.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 502: Vertex List, Section 4.147, p.586+ (614+) 27 | */ 28 | 29 | #ifndef ENTITY_502_H 30 | #define ENTITY_502_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // The associated parameter data are: 37 | // + N: Int: number of vertices in the list 38 | // + P(n): Real[3]: X, Y, Z of points in real space 39 | // 40 | // Forms: 41 | // 1: Vertex List 42 | // 43 | // Unused DE items: 44 | // + Structure 45 | // + Line Font Pattern 46 | // + View 47 | // + Transformation Matrix 48 | // + Line weight 49 | // + Color number 50 | // 51 | 52 | 53 | /** 54 | * Class IGES_ENTITY_502 55 | * represents the Vertex List entity 56 | */ 57 | class IGES_ENTITY_502 : public IGES_ENTITY 58 | { 59 | protected: 60 | 61 | friend class IGES; 62 | virtual bool format( int &index ); 63 | virtual bool rescale( double sf ); 64 | 65 | public: 66 | std::vector vertices; //< list of vertices comprising this entity 67 | 68 | // public functions for libIGES only 69 | virtual bool associate(std::vector *entities); 70 | virtual bool unlink(IGES_ENTITY *aChild); 71 | virtual bool isOrphaned( void ); 72 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 73 | virtual bool delReference(IGES_ENTITY *aParentEntity); 74 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 75 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 76 | 77 | public: 78 | IGES_ENTITY_502( IGES* aParent ); 79 | virtual ~IGES_ENTITY_502(); 80 | 81 | // Inherited virtual functions 82 | virtual bool SetTransform( IGES_ENTITY* aTransform ); 83 | virtual bool SetEntityForm( int aForm ); 84 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 85 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 86 | // parameters not supported by the specification: 87 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 88 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 89 | virtual bool SetView( IGES_ENTITY* aView ); 90 | virtual bool SetColor( IGES_COLOR aColor ); 91 | virtual bool SetColor( IGES_ENTITY* aColor ); 92 | virtual bool SetLineWeightNum( int aLineWeight ); 93 | 94 | // functions unique to E502 95 | 96 | /** 97 | * Function GetVertices 98 | * returns a pointer to the group of vertices comprising this Vertex List entity 99 | */ 100 | const bool GetVertices( size_t& aListSize, MCAD_POINT const*& aPointList ); 101 | 102 | 103 | /** 104 | * Function GetNVertices 105 | * returns the number of vertices comprising this Vertex List entity 106 | */ 107 | size_t GetNVertices( void ); 108 | 109 | 110 | /** 111 | * Function AddVertex 112 | * adds a Model Space vertex to this Vertex List entity 113 | */ 114 | void AddVertex( MCAD_POINT aPoint ); 115 | }; 116 | 117 | #endif // ENTITY_502_H 118 | -------------------------------------------------------------------------------- /src/include/core/entity514.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity514.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 514: Shell, Section 4.151, p.595+ (623+) 27 | */ 28 | 29 | #ifndef ENTITY_514_H 30 | #define ENTITY_514_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // The associated parameter data are: 37 | // + N: Int: number of edge tuples 38 | // + CURV(n): Int: DE to curve entity (100, 102, 104, 106/(11,12,63), 110, 112, 126, 130) 39 | // + SVP(n): Int: DE of Vertex Entity (E502-1) for start vertex 40 | // + SV(n): Int: List Index of Vertex in SVP(n) for start vertex 41 | // + TVP(n): Int: DE of Vertex Entity (E502-1) for terminate vertex 42 | // + TV(n): Int: List Index of Vertex in TVP(n) for terminate vertex 43 | // 44 | // Forms: 45 | // 1: Vertex List 46 | // 47 | // Unused DE items: 48 | // + Structure 49 | // + Line Font Pattern 50 | // + View 51 | // + Transformation Matrix 52 | // + Line weight 53 | // + Color number 54 | // 55 | 56 | class IGES_ENTITY_510; 57 | 58 | 59 | /** 60 | * Class IGES_ENTITY_514 61 | * represents the Shell Entity 62 | */ 63 | class IGES_ENTITY_514 : public IGES_ENTITY 64 | { 65 | protected: 66 | 67 | friend class IGES; 68 | virtual bool format( int &index ); 69 | virtual bool rescale( double sf ); 70 | 71 | public: 72 | std::list< std::pair > ifaces; //< DE and OFlag for faces 73 | std::vector< std::pair > mfaces; //< faces of the shell 74 | 75 | // public functions for libIGES only 76 | virtual bool associate(std::vector *entities); 77 | virtual bool unlink(IGES_ENTITY *aChild); 78 | virtual bool isOrphaned( void ); 79 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 80 | virtual bool delReference(IGES_ENTITY *aParentEntity); 81 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 82 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 83 | 84 | public: 85 | IGES_ENTITY_514( IGES* aParent ); 86 | virtual ~IGES_ENTITY_514(); 87 | 88 | // Inherited virtual functions 89 | virtual bool SetTransform( IGES_ENTITY* aTransform ); 90 | virtual bool SetEntityForm( int aForm ); 91 | // parameters not supported by the specification: 92 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 93 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 94 | virtual bool SetView( IGES_ENTITY* aView ); 95 | virtual bool SetColor( IGES_COLOR aColor ); 96 | virtual bool SetColor( IGES_ENTITY* aColor ); 97 | virtual bool SetLineWeightNum( int aLineWeight ); 98 | 99 | // functions unique to E514 100 | // WARNING: TO BE IMPLEMENTED 101 | // Access methods must be provided if a user ever wishes to create 102 | // a MSBO 103 | // XXX - TO BE IMPLEMENTED 104 | }; 105 | 106 | #endif // ENTITY_514_H 107 | -------------------------------------------------------------------------------- /src/include/core/entityNULL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entityNULL.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: IGES Entity 0: NULL, Section 4.2, p.65 (93) 27 | */ 28 | 29 | #ifndef ENTITY_NULL_H 30 | #define ENTITY_NULL_H 31 | 32 | #include 33 | #include 34 | 35 | // NOTE: 36 | // It is impossible to reliably determine the entity type 37 | // of a DE entry which has been set to NULL; as such, all 38 | // NULL entities may be safely destroyed upon verification 39 | // of the relationships of entities ('Associate' method 40 | // has been executed). Destroying this essentially unrecoverable 41 | // data will help ensure neater output files. Note that the 42 | // deletion of dangling entities is another matter. 43 | // 44 | // All currently unsupported entities should also be treated 45 | // as a NULL Entity 46 | // 47 | // Unused DE items: 48 | // + Structure 49 | // + Line Font Pattern 50 | // + Level 51 | // + View 52 | // + Transformation Matrix 53 | // + Label Display Association 54 | // + Line weight 55 | // + Color number 56 | // + Form number 57 | // 58 | 59 | 60 | /** 61 | * Class IGES_ENTITY_NULL 62 | * represents the NULL Entity (Type 0) and all non-implemented entities. 63 | */ 64 | class IGES_ENTITY_NULL : IGES_ENTITY 65 | { 66 | private: 67 | int trueEntity; // actual Entity Type; non-zero in the case of 68 | // a currently unsupported entity 69 | 70 | protected: 71 | 72 | friend class IGES; 73 | void setEntityType( int aEntityID ); 74 | virtual bool format( int &index ); 75 | virtual bool rescale( double sf ); 76 | 77 | public: 78 | // public functions for libIGES only 79 | virtual bool associate(std::vector *entities); 80 | virtual bool unlink(IGES_ENTITY *aChild); 81 | virtual bool isOrphaned( void ); 82 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 83 | virtual bool delReference(IGES_ENTITY *aParentEntity); 84 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 85 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 86 | virtual bool writeDE(std::ofstream &aFile); 87 | virtual bool writePD(std::ofstream &aFile); 88 | 89 | public: 90 | IGES_ENTITY_NULL( IGES* aParent ); 91 | virtual ~IGES_ENTITY_NULL(); 92 | 93 | /** 94 | * Function GetTrueEntityType 95 | * returns the number representing the true entity type 96 | * represented by this instance of the NULL Entity; in the 97 | * case of a true NULL Entity the return value will be zero 98 | * while for unimplemented entities the return value will be 99 | * non-zero. 100 | */ 101 | int GetTrueEntityType(void) 102 | { 103 | return trueEntity; 104 | } 105 | 106 | // Inherited virtual functions 107 | virtual bool SetEntityForm( int aForm ); 108 | virtual bool SetLineFontPattern( IGES_LINEFONT_PATTERN aPattern ); 109 | virtual bool SetLineFontPattern( IGES_ENTITY* aPattern ); 110 | virtual bool SetLevel( int aLevel ); 111 | virtual bool SetLevel( IGES_ENTITY* aLevel ); 112 | virtual bool SetView( IGES_ENTITY* aView ); 113 | virtual bool SetTransform( IGES_ENTITY* aTransform ); 114 | virtual bool SetLabelAssoc( IGES_ENTITY* aLabelAssoc ); 115 | virtual bool SetColor( IGES_COLOR aColor ); 116 | virtual bool SetColor( IGES_ENTITY* aColor ); 117 | virtual bool SetLineWeightNum( int aLineWeight ); 118 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 119 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 120 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 121 | }; 122 | 123 | #endif // ENTITY_NULL_H 124 | -------------------------------------------------------------------------------- /src/include/core/entity_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: entity_template.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: Sample entity template based on 7 | * IGES Entity 124: Transformation Matrix, Section 4.21, p.123+ (151+) 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | /* 29 | * Notes: 30 | * 1. When Status Flag Number components are not supported any call to 31 | * change the component is ignored and the method shall return true; 32 | * optionally a warning message may be printed. 33 | * 2. Any call to change values of unsupported Directory Entry parameters 34 | * will fail and the method shall return false; a [BUG] message is 35 | * required in these instances. 36 | * 3. Curve entities shall have a GetStartPoint() and GetEndPoint() 37 | * method which reports the first and last point of the curve; this is 38 | * required to check the validity of a Composite Curve. 39 | * 4. Curve entities shall implement: 40 | * GetNSegments( void ) : number of segments in a compound item 41 | * 4. Curve entities must also support an Interpolation Function: 42 | * bool F( Point&, nSegment, var ) where nSegments = number of segments and 43 | * var = 0..1. 'Point' and 'Connect Point' entities shall report 44 | * nSegment = 0 and users shall not call an interpolator. 45 | */ 46 | 47 | #error This is a template only and not suitable for compilation or inclusion 48 | 49 | #ifndef ENTITY_TEMP_H 50 | #define ENTITY_TEMP_H 51 | 52 | // include iges_curve rather than iges_entity for curve entities 53 | #include 54 | 55 | // NOTE: 56 | // The associated parameter data are: 57 | // + R11: Real: Top Row 58 | // + R12: Real: 59 | // + R13: Real: 60 | // + T1: Real: 61 | // + R21: Real: Second Row 62 | // + R22: Real: 63 | // + R23: Real: 64 | // + T2: Real: 65 | // + R21: Real: Third Row 66 | // + R22: Real: 67 | // + R23: Real: 68 | // + T2: Real: 69 | // 70 | // Forms: 71 | // 0: Matrix is Orthonormal and with a Determinant of 1; output will be in a Right-Hand Coordinate System 72 | // 1: Matrix is Orthonormal and with a Determinant of -1; output will be in a Left-Hand Coordinate System 73 | // 10, 11, 12: For Finite Element Analysis only 74 | // 75 | // Unused DE items: 76 | // + Structure 77 | // + Line Font Pattern 78 | // + Level 79 | // + View 80 | // + Label Display Association 81 | // + Line weight 82 | // + Color number 83 | // 84 | 85 | class IGES_ENTITY_TEMP : public IGES_ENTITY 86 | { 87 | protected: 88 | 89 | friend class IGES; 90 | virtual bool format( int &index ); 91 | virtual bool rescale( double sf ); 92 | // XXX - TO BE IMPLEMENTED 93 | 94 | public: 95 | // public functions for libIGES only 96 | virtual bool associate(std::vector *entities); 97 | virtual bool unlink(IGES_ENTITY *aChild); 98 | virtual bool isOrphaned( void ); 99 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate); 100 | virtual bool delReference(IGES_ENTITY *aParentEntity); 101 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar); 102 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar); 103 | 104 | public: 105 | // Inherited virtual functions 106 | virtual void Compact( void ); 107 | virtual bool SetEntityForm( int aForm ); 108 | virtual bool SetDependency( IGES_STAT_DEPENDS aDependency ); 109 | virtual bool SetEntityUse( IGES_STAT_USE aUseCase ); 110 | virtual bool SetHierarchy( IGES_STAT_HIER aHierarchy ); 111 | 112 | // XXX - TO BE IMPLEMENTED 113 | 114 | }; 115 | 116 | #endif // ENTITY_TEMP_H 117 | -------------------------------------------------------------------------------- /src/include/core/iges_curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: iges_curve.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * This file is part of libIGES. 7 | * 8 | * libIGES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * libIGES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, If not, see 20 | * or write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | /* 26 | * Description: Base entity of all IGES Entity classes which represent curves. 27 | * These include: 28 | * 100 ENT_CIRCULAR_ARC 29 | * 104 ENT_CONIC_ARC 30 | * 110 ENT_LINE 31 | * 112 ENT_PARAM_SPLINE_CURVE 32 | * 116 *ENT_POINT 33 | * 126 ENT_NURBS_CURVE 34 | * 132 *ENT_CONNECT_POINT 35 | * 106 ENT_COPIOUS_DATA FORMS: 36 | * 1, 2, 3 37 | * 11, 12, 13 38 | * 63 39 | */ 40 | 41 | #ifndef IGES_CURVE_H 42 | #define IGES_CURVE_H 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | class IGES; // Overarching data structure and parent to all entities 54 | struct IGES_RECORD; // Partially parsed single line of data from an IGES file 55 | 56 | /** 57 | * Class IGES_CURVE 58 | * is the base class of all IGES Curve entities 59 | */ 60 | class IGES_CURVE : public IGES_ENTITY 61 | { 62 | protected: 63 | 64 | // members inherited from IGES_ENTITY 65 | virtual bool format( int &index ) = 0; 66 | virtual bool rescale( double sf ) = 0; 67 | 68 | public: 69 | // public functions for libIGES only 70 | virtual bool associate(std::vector *entities) = 0; 71 | virtual bool unlink(IGES_ENTITY *aChild) = 0; 72 | virtual bool isOrphaned( void ) = 0; 73 | virtual bool addReference(IGES_ENTITY *aParentEntity, bool &isDuplicate) = 0; 74 | virtual bool delReference(IGES_ENTITY *aParentEntity) = 0; 75 | virtual bool readDE(IGES_RECORD *aRecord, std::ifstream &aFile, int &aSequenceVar) = 0; 76 | virtual bool readPD(std::ifstream &aFile, int &aSequenceVar) = 0; 77 | 78 | public: 79 | IGES_CURVE( IGES* aParent ); 80 | virtual ~IGES_CURVE(); 81 | 82 | // specialized members of this class 83 | // methods required of parameterized curve entities 84 | 85 | /** 86 | * Function IsClosed 87 | * returns true if this entity represents a closed curve 88 | */ 89 | virtual bool IsClosed( void ) = 0; 90 | 91 | 92 | /** 93 | * Function GetNCurves 94 | * returns the number of curves in this object; return values are: 95 | * -2 = Point or Point Association entity (no curves) 96 | * -1 = no valid curve entities assigned 97 | * 0 = simple curve entity such as a circle or NURBS curve 98 | * 1+ = # of internal curve entities, each of which may also be composite 99 | */ 100 | virtual int GetNCurves( void ) = 0; 101 | 102 | 103 | /** 104 | * Function GetCurve 105 | * returns the a pointer to the associated curve entity with the given index 106 | * or NULL if no such entity exists. 107 | */ 108 | virtual IGES_CURVE* GetCurve( int index ) = 0; 109 | 110 | 111 | /** 112 | * Function GetStartPoint 113 | * retrieves the start point of this curve entity and returns true 114 | * on success. 115 | * 116 | * @param pt = variable to store the start point 117 | * @param xform = set to true to apply any associated transforms to the point 118 | */ 119 | virtual bool GetStartPoint( MCAD_POINT& pt, bool xform = true ) = 0; 120 | 121 | 122 | /** 123 | * Function GetEndPoint 124 | * retrieves the end point of this curve entity and returns true 125 | * on success. 126 | * 127 | * @param pt = variable to store the end point 128 | * @param xform = set to true to apply any associated transforms to the point 129 | */ 130 | virtual bool GetEndPoint( MCAD_POINT& pt, bool xform = true ) = 0; 131 | 132 | 133 | /** 134 | * Function GetNSegments 135 | * returns the number of segments within this curve entity; for 136 | * composite curves this may be the same as GetNCurves but in the 137 | * case of piece-wise linear collections this would be the number 138 | * of segments to iterate over 139 | */ 140 | virtual int GetNSegments( void ) = 0; 141 | 142 | 143 | // members inherited from IGES_ENTITY 144 | virtual bool SetEntityForm( int aForm ) = 0; 145 | }; 146 | 147 | #endif // IGES_CURVE_H 148 | -------------------------------------------------------------------------------- /src/include/error_macros.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define ERRMSG std::cerr << __FILE__ << ":" << __LINE__ << ":"\ 4 | << __FUNCTION__ << "(): " 5 | -------------------------------------------------------------------------------- /src/include/geom/geom_cylinder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: geom_cylinder.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: object to aid in creating a vertical cylindrical 7 | * surface within IGES. 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | #ifndef IGES_GEOM_CYLINDER_H 29 | #define IGES_GEOM_CYLINDER_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | class IGES; 36 | class IGES_ENTITY_144; 37 | 38 | class MCAD_API IGES_GEOM_CYLINDER 39 | { 40 | private: 41 | MCAD_POINT arcs[5]; // center, start .. end for series of sub-arcs; 42 | // the end point of one sub-arc is the start 43 | // of the next 44 | int narcs; // number of arc segments to represent the surface 45 | double radius; 46 | double angles[6]; // start/end angles for arc1, arc2, arc3 47 | 48 | void init( void ); 49 | void clear( void ); 50 | 51 | public: 52 | IGES_GEOM_CYLINDER(); 53 | ~IGES_GEOM_CYLINDER(); 54 | 55 | bool SetParams( MCAD_POINT center, MCAD_POINT start, MCAD_POINT end ); 56 | 57 | /** 58 | * Function Instantiate 59 | * uses current parameters to create IGES entities which represent 60 | * a cylindrical arc. If data is returned in 'result' the 61 | * caller is responsible for deleting the pointer array when it 62 | * is no longer needed. 63 | * 64 | * @param model is the IGES object which will own the entities 65 | * created. 66 | * @param top is the height of the top of the cylindrical arc 67 | * @param bot is the height of the bottom of the cylindrical arc 68 | * @param result [out] is a list of pointers to the Trimmed 69 | * Parametric Surfaces which represent the cylindrical arc; 70 | * if non-NULL on return the caller is responsible for calling 71 | * delete[] on the pointer. 72 | * @param nParts will hold the number of surface pointers in 73 | * 'result' 74 | * @return true if the cylindrical arc was successfully 75 | * instantiated; in such a case 'result' will be non-null 76 | */ 77 | bool Instantiate( IGES* model, double top, double bot, 78 | IGES_ENTITY_144**& result, int& nParts, bool aReverse ); 79 | }; 80 | 81 | #endif // IGES_GEOM_CYLINDER_H 82 | -------------------------------------------------------------------------------- /src/include/geom/geom_wall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: geom_wall.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: object to aid in the creation of a rectangular 7 | * surface within IGES 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | #ifndef IGES_GEOM_WALL_H 29 | #define IGES_GEOM_WALL_H 30 | 31 | #include 32 | #include 33 | 34 | struct SISLSurf; 35 | struct SISLCurve; 36 | 37 | class IGES; 38 | class IGES_ENTITY_144; 39 | 40 | class MCAD_API IGES_GEOM_WALL 41 | { 42 | private: 43 | SISLSurf* plane; // NURBS representation of the plane 44 | SISLCurve* side[4]; // Representation of the 4 bounding edges 45 | MCAD_POINT vertex[4]; // vertices as specified by the user 46 | 47 | void init( void ); 48 | void clear( void ); 49 | 50 | public: 51 | IGES_GEOM_WALL(); 52 | ~IGES_GEOM_WALL(); 53 | 54 | bool SetParams( MCAD_POINT p0, MCAD_POINT p1, MCAD_POINT p2, MCAD_POINT p3 ); 55 | IGES_ENTITY_144* Instantiate( IGES* model ); 56 | }; 57 | 58 | #endif // IGES_GEOM_WALL_H 59 | -------------------------------------------------------------------------------- /src/include/geom/mcad_helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: mcad_helpers.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: miscellaneous useful functions 7 | * 8 | * This file is part of libIGES. 9 | * 10 | * libIGES is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * libIGES is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this library; if not, If not, see 22 | * or write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | * 25 | */ 26 | 27 | #ifndef MCAD_HELPERS_H 28 | #define MCAD_HELPERS_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | // return true if the 2 points match to within 'minRes' 35 | MCAD_API bool PointMatches( MCAD_POINT p1, MCAD_POINT p2, double minRes ); 36 | 37 | // check and renormalize a vector; return false if vector is invalid 38 | MCAD_API bool CheckNormal(double& X, double &Y, double& Z); 39 | 40 | // print out an IGES transform 41 | struct MCAD_TRANSFORM; 42 | MCAD_API void print_transform(const MCAD_TRANSFORM* T); 43 | 44 | // print out an IGES matrix 45 | struct MCAD_MATRIX; 46 | MCAD_API void print_matrix(const MCAD_MATRIX* m); 47 | 48 | // print out an IGES point (decimal places limited to 3) 49 | struct MCAD_POINT; 50 | MCAD_API void print_vec(const MCAD_POINT* p); 51 | 52 | // calculate the normal given points p0, p1, p2 53 | MCAD_API bool CalcNormal( const MCAD_POINT* p0, const MCAD_POINT* p1, const MCAD_POINT* p2, MCAD_POINT* pn ); 54 | 55 | #endif // MCAD_HELPERS_H 56 | -------------------------------------------------------------------------------- /src/include/geom/mcad_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * file: mcad_utils.h 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: miscellaneous routines required by the IGES 7 | * preprocessor 8 | * 9 | * This file is part of libIGES. 10 | * 11 | * libIGES is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * libIGES is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, If not, see 23 | * or write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | 29 | #ifndef MCAD_UTILS_H 30 | #define MCAD_UTILS_H 31 | 32 | #include 33 | #include 34 | 35 | class MCAD_API MCAD_FILEPATH 36 | { 37 | private: 38 | std::string* m_fullpath; 39 | std::string* m_filename; 40 | std::string* m_basename; 41 | std::string* m_ext; 42 | char pathsep; // directory separator 43 | char altsep; // dir separator on complementary system 44 | 45 | public: 46 | MCAD_FILEPATH(); 47 | MCAD_FILEPATH( const char* aPath ); 48 | ~MCAD_FILEPATH(); 49 | 50 | /** 51 | * Function SetPath 52 | * takes a path and automatically converts the pathname separator; 53 | * naturally this operation will produce bad results if the actual path 54 | * contains characters which represent a path separator on another system. 55 | * 56 | * @param aPath [in] is the path name to use 57 | * @return true if the path was successfully converted or is empty 58 | */ 59 | bool SetPath( const char* aPath ); 60 | 61 | /** 62 | * Function Exists 63 | * returns true if the full path (directory or file) exists 64 | */ 65 | bool Exists( void ); 66 | 67 | /** 68 | * Function DirExists 69 | * returns true if the full path exists and is a directory 70 | */ 71 | bool DirExists( void ); 72 | 73 | /** 74 | * Function DirExists 75 | * returns true if the full path exists and is a file 76 | */ 77 | bool FileExists( void ); 78 | 79 | /** 80 | * Function GetFullPath 81 | * returns the current full path; this may be a path to a file or a directory 82 | */ 83 | const char* GetFullPath( void ); 84 | 85 | /** 86 | * Function GetFileName 87 | * takes the last part of the path spec as a filename and returns it 88 | */ 89 | const char* GetFileName( void ); 90 | 91 | /** 92 | * Function GetBaseName 93 | * takes the last part of the path spec as a filename, strips a single 94 | * extension if there is one, and returns the base name 95 | */ 96 | const char* GetBaseName( void ); 97 | 98 | /** 99 | * Function GetExtension 100 | * takes the last part of the path spec as a filename, checks for an 101 | * extension and returns it 102 | */ 103 | const char* GetExtension( void ); 104 | 105 | bool SetExtension( const char* anExt ); 106 | 107 | /** 108 | * Function GetPathSep 109 | * returns the path separator native to the operating system 110 | */ 111 | char GetPathSep( void ); 112 | 113 | /** 114 | * Function Append 115 | * appends a path separator if the current path is not empty and 116 | * appends the given string 117 | */ 118 | bool Append( const char* aSubPath ); 119 | }; 120 | 121 | #endif // MCAD_UTILS_H 122 | -------------------------------------------------------------------------------- /src/libigesconf.h.in: -------------------------------------------------------------------------------- 1 | // Main configuration file for the libIGES project 2 | #ifndef LIBIGESCONF_H 3 | #define LIBIGESCONF_H 4 | 5 | // Version 6 | #define LIB_VERSION_MAJOR (@LIBIGES_VERSION_MAJOR@) 7 | #define LIB_VERSION_MINOR (@LIBIGES_VERSION_MINOR@) 8 | 9 | // indicates if IGES is being built as a static lib 10 | #cmakedefine STATIC_IGES 11 | 12 | #if defined( _MSC_VER ) 13 | #if defined(_DLL) 14 | #define MCAD_API __declspec( dllexport ) 15 | #else // DLL import 16 | #define MCAD_API __declspec( dllimport ) 17 | #endif 18 | #else // not an MSVC compiler 19 | #define MCAD_API 20 | #endif // defined( _MSC_VER ) 21 | 22 | // SISL 23 | #cmakedefine USE_SISL 24 | #cmakedefine HAS_NURBS_LIB 25 | 26 | #endif // LIBIGESCONF_H 27 | -------------------------------------------------------------------------------- /src/tests/test_circle.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: test_circle.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: 7 | * This program attempts to create a 3D compound curve in which 8 | * a complete circular arc is represented by a single 9-point 9 | * NURBS curve. If the result is generally accepted by MCADS, 10 | * this may simplify the IGES models generated by the geom_pcb 11 | * classes due to the compact form of the NURBS in comparison 12 | * to the many-point Polynomial B-Spline currently used to 13 | * represent circular arcs. 14 | * 15 | * This file is part of libIGES. 16 | * 17 | * libIGES is free software; you can redistribute it and/or 18 | * modify it under the terms of the GNU Lesser General Public 19 | * License as published by the Free Software Foundation; either 20 | * version 2.1 of the License, or (at your option) any later version. 21 | * 22 | * libIGES is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 | * Lesser General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU Lesser General Public 28 | * License along with this library; if not, If not, see 29 | * or write to the Free Software 30 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 31 | * 32 | */ 33 | 34 | /* 35 | * COMMENTS: 36 | * 1. OK - FreeCAD recognizes the arcs and by rotating the control points only a 37 | * single NURBS curve is needed to represent any circular arc of any start/ 38 | * stop angle. 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | int main() 47 | { 48 | DLL_IGES model; 49 | 50 | DLL_IGES_ENTITY_102 compound( model, true ); 51 | 52 | DLL_IGES_ENTITY_126 nc( model, true ); 53 | 54 | double SQHALF = sqrt( 0.5 ); 55 | double cknots[] = { 0.0, 0.0, 0.0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1.0, 1.0, 1.0 }; 56 | double cpts[] = { 1.0, 0.0, 0.0, 1.0, 57 | 1.0, 1.0, 0.0, SQHALF, 58 | 0.0, 1.0, 0.0, 1, 59 | -1.0, 1.0, 0.0, SQHALF, 60 | -1.0, 0.0, 0.0, 1, 61 | -1.0, -1.0, 0.0, SQHALF, 62 | 0.0, -1.0, 0.0, 1, 63 | 1.0, -1.0, 0.0, SQHALF, 64 | 1.0, 0.0, 0.0, 1 65 | }; 66 | 67 | double cpts2[] = { 1.0, 0.0, -5.0, 1.0, 68 | 1.0, 1.0, -5.0, SQHALF, 69 | 0.0, 1.0, -5.0, 1, 70 | -1.0, 1.0, -5.0, SQHALF, 71 | -1.0, 0.0, -5.0, 1, 72 | -1.0, -1.0, -5.0, SQHALF, 73 | 0.0, -1.0, -5.0, 1, 74 | 1.0, -1.0, -5.0, SQHALF, 75 | 1.0, 0.0, -5.0, 1 76 | }; 77 | 78 | nc.SetNURBSData( 9, 3, cknots, cpts, true, 0.125, 1 ); 79 | nc.NewEntity(); 80 | nc.SetNURBSData( 9, 3, cknots, cpts2, true, 0.125, 1 ); 81 | 82 | model.Write( "circle.igs", true ); 83 | 84 | return 0; 85 | } 86 | 87 | using namespace std; 88 | -------------------------------------------------------------------------------- /src/tests/test_read.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * file: test_read.cpp 3 | * 4 | * Copyright 2015, Dr. Cirilo Bernardo (cirilo.bernardo@gmail.com) 5 | * 6 | * Description: This program reads an IGES file and writes it 7 | * back out as 'test_out_read.igs'. This tests the current 8 | * implementation's ability to recognize entities within the 9 | * given input file; unhandled entities will be culled and 10 | * incorrectly implemented entities may result in a corrupt 11 | * IGES file. The informational output messages usually 12 | * provide some hints about the issues reading the given 13 | * input file. 14 | * 15 | * This file is part of libIGES. 16 | * 17 | * libIGES is free software; you can redistribute it and/or 18 | * modify it under the terms of the GNU Lesser General Public 19 | * License as published by the Free Software Foundation; either 20 | * version 2.1 of the License, or (at your option) any later version. 21 | * 22 | * libIGES is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 | * Lesser General Public License for more details. 26 | * 27 | * You should have received a copy of the GNU Lesser General Public 28 | * License along with this library; if not, If not, see 29 | * or write to the Free Software 30 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 31 | * 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #define ONAME "test_out_read.igs" 40 | 41 | using namespace std; 42 | 43 | void print_vec( const MCAD_POINT p ) 44 | { 45 | cerr << setprecision( 3 ); 46 | cerr << "V: " << p.x << ", " << p.y << ", " << p.z << "\n"; 47 | return; 48 | } 49 | 50 | int main( int argc, char **argv ) 51 | { 52 | if( argc != 2 ) 53 | { 54 | cerr << "*** Usage: readtest modelname\n"; 55 | return -1; 56 | } 57 | 58 | DLL_IGES model; 59 | 60 | if( !model.Read( argv[1] ) ) 61 | { 62 | cerr << "Oops - too bad, better luck next time\n"; 63 | } 64 | else 65 | { 66 | cerr << "[OK]: things are looking good\n"; 67 | } 68 | 69 | model.Write( ONAME, true ); 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /tutorial/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project: libIGES (IGESv6) 2 | # 3 | project( IGES_TUTORIAL CXX C ) 4 | 5 | cmake_minimum_required( VERSION 3.0 FATAL_ERROR ) 6 | 7 | set( CMAKE_VERBOSE_MAKEFILE ON ) 8 | 9 | if( NOT IGES_INCLUDES ) 10 | set( IGES_INCLUDES $ENV{HOME}/usr/include/iges ) 11 | endif() 12 | 13 | if( NOT IGES_LIB_PATH ) 14 | set( IGES_LIB_PATH $ENV{HOME}/usr/lib ) 15 | endif() 16 | 17 | include_directories( ${IGES_INCLUDES} ) 18 | link_directories( ${IGES_LIB_PATH} ) 19 | 20 | add_executable( tutorial1 tutorial1.cpp ) 21 | target_link_libraries( tutorial1 iges ) 22 | --------------------------------------------------------------------------------