mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-04 01:48:54 +00:00
Libopencad is a library written in C++11, which provides a way to
read/write CAD (DWG/DXF/DXFB) files. It was designed to have a uniformal API to work with any CAD files. It has a base class - CADFile. Inheriting this class it's possible to create a driver for any CAD format, all you need to do - is to overwrite interface functions like GetGeometry(index), and others. Now it has an implementation for DWG2000 (R15), but only for read. Library comes with cadinfo utility, which prints out everything library can get from file - header variables, CAD custom classes, presented layers and geometries with their attributes. WWW: https://trac.osgeo.org/gdal/wiki/DWG_driver PR: 212129 Submitted by: lbartoletti@tuxfamily.org
This commit is contained in:
parent
23c582ea81
commit
7219fadffa
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=429524
@ -49,6 +49,7 @@
|
||||
SUBDIR += layouteditor
|
||||
SUBDIR += ldraw
|
||||
SUBDIR += leocad
|
||||
SUBDIR += libopencad
|
||||
SUBDIR += librecad
|
||||
SUBDIR += linux-eagle5
|
||||
SUBDIR += linuxcnc-devel
|
||||
|
22
cad/libopencad/Makefile
Normal file
22
cad/libopencad/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
# Created by: lbartoletti <lbartoletti@tuxfamily.org>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= libopencad
|
||||
PORTVERSION= 0.2.0
|
||||
CATEGORIES= cad graphics geography
|
||||
|
||||
MAINTAINER= lbartoletti@tuxfamily.org
|
||||
COMMENT= Library which provides a way to read/write CAD (DWG/DXF/DXFB) files
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
BROKEN_FreeBSD_9= does not build (lack of c++11 support)
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= sandyre
|
||||
|
||||
USES= cmake compiler:c++11-lib
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
.include <bsd.port.mk>
|
3
cad/libopencad/distinfo
Normal file
3
cad/libopencad/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
TIMESTAMP = 1472070376
|
||||
SHA256 (sandyre-libopencad-0.2.0_GH0.tar.gz) = 181a33fd8bc6046366c9d5d3a22590817d8f4ab7b87efdeac9fecdc34fe94019
|
||||
SIZE (sandyre-libopencad-0.2.0_GH0.tar.gz) = 4245877
|
29
cad/libopencad/files/patch-lib_cadheader.cpp
Normal file
29
cad/libopencad/files/patch-lib_cadheader.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
--- lib/cadheader.cpp.orig 2016-08-24 13:25:41 UTC
|
||||
+++ lib/cadheader.cpp
|
||||
@@ -243,6 +243,17 @@ CADVariant::CADVariant( const char * val
|
||||
dateTimeVal = 0;
|
||||
}
|
||||
|
||||
+CADVariant::CADVariant( long val )
|
||||
+{
|
||||
+ type = DataType ::DECIMAL;
|
||||
+ decimalVal = val;
|
||||
+ stringVal = to_string( decimalVal );
|
||||
+ xVal = 0;
|
||||
+ yVal = 0;
|
||||
+ zVal = 0;
|
||||
+ dateTimeVal = 0;
|
||||
+}
|
||||
+
|
||||
CADVariant::CADVariant( int val )
|
||||
{
|
||||
type = DataType::DECIMAL;
|
||||
@@ -303,7 +314,7 @@ CADVariant::CADVariant( const string& va
|
||||
dateTimeVal = 0;
|
||||
}
|
||||
|
||||
-CADVariant::CADVariant( time_t val )
|
||||
+CADVariant::CADVariant( time_t val, bool bIsTime )
|
||||
{
|
||||
type = DataType::DATETIME;
|
||||
dateTimeVal = val;
|
25
cad/libopencad/files/patch-lib_cadheader.h
Normal file
25
cad/libopencad/files/patch-lib_cadheader.h
Normal file
@ -0,0 +1,25 @@
|
||||
--- lib/cadheader.h.orig 2016-08-24 13:25:41 UTC
|
||||
+++ lib/cadheader.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
+#include <ctime>
|
||||
|
||||
class OCAD_EXTERN CADHandle final
|
||||
{
|
||||
@@ -64,12 +65,13 @@ public:
|
||||
CADVariant();
|
||||
CADVariant( const char * val );
|
||||
CADVariant( int val );
|
||||
+ CADVariant( long val );
|
||||
CADVariant( short val );
|
||||
CADVariant( double val );
|
||||
CADVariant( double x, double y, double z = 0 );
|
||||
CADVariant( const CADHandle& val );
|
||||
CADVariant( const std::string& val );
|
||||
- CADVariant( time_t val );
|
||||
+ CADVariant( time_t val, bool bIsTime );
|
||||
public:
|
||||
CADVariant( const CADVariant& orig );
|
||||
CADVariant& operator=( const CADVariant& orig );
|
14
cad/libopencad/files/patch-tests_CMakeLists.txt
Normal file
14
cad/libopencad/files/patch-tests_CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
--- tests/CMakeLists.txt.orig 2016-08-24 13:25:41 UTC
|
||||
+++ tests/CMakeLists.txt
|
||||
@@ -41,10 +41,8 @@ if(BUILD_TESTS)
|
||||
|
||||
|
||||
find_package(Threads)
|
||||
- set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${TARGET_LINK})
|
||||
+ set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TARGET_LINK})
|
||||
|
||||
- find_library(DL_LIB dl)
|
||||
- set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${DL_LIB})
|
||||
find_library(M_LIB m)
|
||||
set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${M_LIB})
|
||||
|
17
cad/libopencad/pkg-descr
Normal file
17
cad/libopencad/pkg-descr
Normal file
@ -0,0 +1,17 @@
|
||||
Libopencad is a library written in C++11, which provides a way to
|
||||
read/write CAD (DWG/DXF/DXFB) files. It was designed to have a
|
||||
uniformal API to work with any CAD files.
|
||||
|
||||
It has a base class - CADFile.
|
||||
|
||||
Inheriting this class it's possible to create a driver for any CAD
|
||||
format, all you need to do - is to overwrite interface functions
|
||||
like GetGeometry(index), and others.
|
||||
|
||||
Now it has an implementation for DWG2000 (R15), but only for read.
|
||||
|
||||
Library comes with cadinfo utility, which prints out everything
|
||||
library can get from file - header variables, CAD custom classes,
|
||||
presented layers and geometries with their attributes.
|
||||
|
||||
WWW: https://trac.osgeo.org/gdal/wiki/DWG_driver
|
14
cad/libopencad/pkg-plist
Normal file
14
cad/libopencad/pkg-plist
Normal file
@ -0,0 +1,14 @@
|
||||
bin/cadinfo
|
||||
include/opencad/cadclasses.h
|
||||
include/opencad/cadcolors.h
|
||||
include/opencad/caddictionary.h
|
||||
include/opencad/cadfile.h
|
||||
include/opencad/cadfileio.h
|
||||
include/opencad/cadgeometry.h
|
||||
include/opencad/cadheader.h
|
||||
include/opencad/cadlayer.h
|
||||
include/opencad/cadobjects.h
|
||||
include/opencad/cadtables.h
|
||||
include/opencad/opencad.h
|
||||
include/opencad/opencad_api.h
|
||||
lib/libopencadstatic.a
|
Loading…
Reference in New Issue
Block a user