Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7e64c405dd | ||
![]() |
cf7db87b38 | ||
![]() |
000bf71a50 | ||
![]() |
27767f7a48 | ||
![]() |
1e56860f88 | ||
![]() |
981f772d81 | ||
![]() |
3b31ab9190 | ||
![]() |
0cbd48bd67 | ||
![]() |
479c406d2b | ||
![]() |
2ecc612801 | ||
![]() |
15446e8f0a |
10
.gitattributes
vendored
|
@ -1,10 +0,0 @@
|
||||||
* text=auto
|
|
||||||
*.cpp text
|
|
||||||
*.h text
|
|
||||||
*.txt text
|
|
||||||
*.gz binary
|
|
||||||
*.ico binary
|
|
||||||
*.jpg binary
|
|
||||||
*.lib binary
|
|
||||||
*.png binary
|
|
||||||
*.slvs binary
|
|
18
.github/ISSUE_TEMPLATE.md
vendored
|
@ -1,18 +0,0 @@
|
||||||
### System information
|
|
||||||
|
|
||||||
SolveSpace version: (e.g. 3.0~3dd2fc00; go to Help → About...)
|
|
||||||
|
|
||||||
Operating system: (e.g. Debian testing)
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
|
|
||||||
What should have happened?
|
|
||||||
|
|
||||||
### Actual behavior
|
|
||||||
|
|
||||||
What actually happened?
|
|
||||||
|
|
||||||
### Additional information
|
|
||||||
|
|
||||||
For bugs, please attach a savefile that shows the problematic behavior.
|
|
||||||
You can attach `.slvs` files by archiving them into a `.zip` first.
|
|
16
.gitignore
vendored
|
@ -1,15 +1 @@
|
||||||
/CMakeCache.txt
|
/build*
|
||||||
/build*/
|
|
||||||
/test/**/*.diff.*
|
|
||||||
/test/**/*.curr.*
|
|
||||||
*.trace
|
|
||||||
/debian/tmp/
|
|
||||||
/debian/*.log
|
|
||||||
/debian/*.substvars
|
|
||||||
/debian/*.debhelper
|
|
||||||
/debian/files
|
|
||||||
/debian/solvespace/
|
|
||||||
/debian/libslvs1/
|
|
||||||
/debian/libslvs1-dev/
|
|
||||||
/obj-*/
|
|
||||||
/*.slvs
|
|
||||||
|
|
22
.gitmodules
vendored
|
@ -1,22 +0,0 @@
|
||||||
[submodule "extlib/zlib"]
|
|
||||||
path = extlib/zlib
|
|
||||||
url = https://github.com/madler/zlib
|
|
||||||
ignore = dirty
|
|
||||||
[submodule "extlib/libpng"]
|
|
||||||
path = extlib/libpng
|
|
||||||
url = https://github.com/glennrp/libpng
|
|
||||||
[submodule "extlib/freetype"]
|
|
||||||
path = extlib/freetype
|
|
||||||
url = http://git.sv.nongnu.org/r/freetype/freetype2.git
|
|
||||||
[submodule "extlib/libdxfrw"]
|
|
||||||
path = extlib/libdxfrw
|
|
||||||
url = https://github.com/solvespace/libdxfrw.git
|
|
||||||
[submodule "extlib/pixman"]
|
|
||||||
path = extlib/pixman
|
|
||||||
url = https://github.com/solvespace/pixman
|
|
||||||
[submodule "extlib/cairo"]
|
|
||||||
path = extlib/cairo
|
|
||||||
url = https://github.com/solvespace/cairo
|
|
||||||
[submodule "extlib/angle"]
|
|
||||||
path = extlib/angle
|
|
||||||
url = https://github.com/solvespace/angle
|
|
29
.travis.yml
|
@ -1,29 +0,0 @@
|
||||||
language: c
|
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
osx_image: xcode8.2
|
|
||||||
install:
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./.travis/install-debian.sh; fi
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/install-macos.sh; fi
|
|
||||||
script:
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./.travis/build-debian.sh; fi
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/build-macos.sh; fi
|
|
||||||
deploy:
|
|
||||||
- provider: releases
|
|
||||||
api_key:
|
|
||||||
secure: dDlkIawHcODlW9B/20/cQCtzeoocvs0hKuNngRKXKqzXLWTRq33oq/B7+39tAixWbmv6exTpijiKrRNFiSCW5Z4iwHLwaRD4XJznxw63e/Hus/dxg2Tvqx7XFpkCz8mT1Z+gZQE5YxAngeZPpI/sZbZtF1UO3yH5eLeeokZ15p26ZskQUPoYuzrTgTzYL3XfpG3F+20rNBawH1ycsCTVD/08/n31d2m3CrKAsbW7er92ek6w4fzKr7NW8WeXjrPJETVpw5fQg1Od3pRGW8dPQaJcvKQEogMp8Mm0ETYd0qigg89/giBz7QwOgmAWQ4dH+DfZH4Ojl//127QztBolMvyDMQBykWrtJoGcij05sT6K2IJr2FHeUBO12MAEdjiVvhQj3DtTzjPiZAHHDBSLWxLKWWhlhHE4pq7g1MQhqXkaAHI2BLNzwLmaowbMT0bECf9yfz6xx18h6XPQFX44oOktraobVALFlyHqeKa8zdcUt22LF6uAL1m5dxL0tny3eXCIPE4UH/RZgua/cHV9G3cUvKQa/QnFSLRhvWVSbGB+7YsHouBJcsUOOW1gmd5442XuC7mpppccRldh+GSxUk6TBJRAx7TeQ0ybDUaoco9MUqp2twv3KreR2+8Q12PDaAhfQVNEGdF3wTm1sShImjCN4VN3eSLlBEbve1QRQXM=
|
|
||||||
skip_cleanup: true
|
|
||||||
file: build/solvespace.dmg
|
|
||||||
on:
|
|
||||||
repo: solvespace/solvespace
|
|
||||||
tags: true
|
|
||||||
condition: "$TRAVIS_OS_NAME == osx"
|
|
||||||
notifications:
|
|
||||||
irc:
|
|
||||||
channels:
|
|
||||||
- "chat.freenode.net#solvespace"
|
|
||||||
use_notice: true
|
|
||||||
skip_join: true
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh -xe
|
|
||||||
|
|
||||||
if echo $TRAVIS_TAG | grep ^v; then BUILD_TYPE=RelWithDebInfo; else BUILD_TYPE=Debug; fi
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
# We build without the GUI until Travis updates to an Ubuntu version with GTK 3.22.
|
|
||||||
cmake .. -DCMAKE_C_COMPILER=clang-3.9 -DCMAKE_CXX_COMPILER=clang++-3.9 \
|
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
||||||
-DENABLE_GUI=OFF \
|
|
||||||
-DENABLE_SANITIZERS=ON
|
|
||||||
make VERBOSE=1
|
|
||||||
make test_solvespace
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/sh -xe
|
|
||||||
|
|
||||||
if echo $TRAVIS_TAG | grep ^v; then BUILD_TYPE=RelWithDebInfo; else BUILD_TYPE=Debug; fi
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
|
||||||
make VERBOSE=1
|
|
||||||
make test_solvespace
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/bin/sh -xe
|
|
||||||
|
|
||||||
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
|
|
||||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
||||||
sudo add-apt-repository -y 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main'
|
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -q -y \
|
|
||||||
cmake cmake-data libpng12-dev zlib1g-dev libjson0-dev libfontconfig1-dev \
|
|
||||||
libgtkmm-3.0-dev libpangomm-1.4-dev libcairo2-dev libgl1-mesa-dev libglu-dev \
|
|
||||||
libfreetype6-dev dpkg-dev libstdc++-5-dev clang-3.9 clang++-3.9 lcov
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh -xe
|
|
||||||
|
|
||||||
brew update
|
|
||||||
brew install freetype cairo
|
|
203
CHANGELOG.md
|
@ -1,203 +0,0 @@
|
||||||
Changelog
|
|
||||||
=========
|
|
||||||
|
|
||||||
3.0
|
|
||||||
---
|
|
||||||
|
|
||||||
New sketch features:
|
|
||||||
* Extrude, lathe, translate and rotate groups can now use the "assembly"
|
|
||||||
boolean operation, to increase performance.
|
|
||||||
* Translate and rotate groups can create n-dimensional arrays using
|
|
||||||
the "difference" and "assembly" boolean operations.
|
|
||||||
* A new sketch in workplane group can be created based on existing workplane.
|
|
||||||
* TTF text request has two additional points on the right side, which allow
|
|
||||||
constraining the width of text.
|
|
||||||
* Image requests can now be created, similar to TTF text requests.
|
|
||||||
This replaces the "style → background image" feature.
|
|
||||||
* Irrelevant points (e.g. arc center point) are not counted when estimating
|
|
||||||
the bounding box used to compute chord tolerance.
|
|
||||||
* When adding a constraint which has a label and is redundant with another
|
|
||||||
constraint, the constraint is added as a reference, avoiding an error.
|
|
||||||
* Datum points can be copied and pasted.
|
|
||||||
|
|
||||||
New constraint features:
|
|
||||||
* When dragging an arc or rectangle point, it will be automatically
|
|
||||||
constrained to other points with a click.
|
|
||||||
* When selecting a constraint, the requests it constraints can be selected
|
|
||||||
in the text window.
|
|
||||||
* When selecting an entity, the constraints applied to it can be selected
|
|
||||||
in the text window.
|
|
||||||
|
|
||||||
New export/import features:
|
|
||||||
* Three.js: allow configuring projection for exported model, and initially
|
|
||||||
use the current viewport projection.
|
|
||||||
* Wavefront OBJ: a material file is exported alongside the model, containing
|
|
||||||
mesh color information.
|
|
||||||
* DXF/DWG: 3D DXF files are imported as construction entities, in 3d.
|
|
||||||
|
|
||||||
New rendering features:
|
|
||||||
* The "Show/hide hidden lines" button is now a tri-state button that allows
|
|
||||||
showing all lines (on top of shaded mesh), stippling occluded lines
|
|
||||||
or not drawing them at all.
|
|
||||||
* The "Show/hide outlines" button is now independent from "Show/hide edges".
|
|
||||||
|
|
||||||
New measurement/analysis features:
|
|
||||||
* New command for measuring total length of selected entities,
|
|
||||||
"Analyze → Measure Perimeter".
|
|
||||||
* New command for measuring center of mass, with live updates as the sketch
|
|
||||||
changes, "Analyze → Center of Mass".
|
|
||||||
* When selecting a point and a line, projected distance to to current
|
|
||||||
workplane is displayed.
|
|
||||||
|
|
||||||
Other new features:
|
|
||||||
* New command-line interface, for batch exporting and more.
|
|
||||||
* New link to match the on-screen size of the sketch with its actual size,
|
|
||||||
"view → set to full scale".
|
|
||||||
* When zooming to fit, constraints are also considered.
|
|
||||||
* When clicking on an entity that shares a place with other entities,
|
|
||||||
the entity from the current group is selected.
|
|
||||||
* When dragging an entity that shares a place with other entities,
|
|
||||||
the entity from a request is selected. For example, dragging a point on
|
|
||||||
a face of an extrusion coincident with the source sketch plane will
|
|
||||||
drag the point from the source sketch.
|
|
||||||
* In expressions, numbers can contain the digit group separator, "_".
|
|
||||||
* The "=" key is bound to "Zoom In", like "+" key.
|
|
||||||
* The numpad decimal separator key is bound to "." regardless of locale.
|
|
||||||
* On Windows, full-screen mode is implemented.
|
|
||||||
|
|
||||||
Bugs fixed:
|
|
||||||
* A point in 3d constrained to any line whose length is free no longer
|
|
||||||
causes the line length to collapse.
|
|
||||||
* Curve-line constraints (in 3d), parallel constraints (in 3d), and
|
|
||||||
same orientation constraints are more robust.
|
|
||||||
* Adding some constraints (vertical, midpoint, etc) twice errors out
|
|
||||||
immediately, instead of later and in a confusing way.
|
|
||||||
* Constraining a newly placed point to a hovered entity does not cause
|
|
||||||
spurious changes in the sketch.
|
|
||||||
* Points highlighted with "Analyze → Show Degrees of Freedom" are drawn
|
|
||||||
on top of all other geometry.
|
|
||||||
|
|
||||||
2.3
|
|
||||||
---
|
|
||||||
|
|
||||||
Bug fixes:
|
|
||||||
* Do not crash when applying a symmetry constraint to two points.
|
|
||||||
* Fix TTF font metrics again (properly this time).
|
|
||||||
* Fix the "draw back faces in red" option.
|
|
||||||
* Fix export of wireframe as 3D DXF.
|
|
||||||
* Various minor crashes.
|
|
||||||
|
|
||||||
2.2
|
|
||||||
---
|
|
||||||
|
|
||||||
Other new features:
|
|
||||||
* OS X: support 3Dconnexion devices (SpaceMouse, SpaceNavigator, etc).
|
|
||||||
* GTK: files with uppercase extensions can be opened.
|
|
||||||
|
|
||||||
Bug fixes:
|
|
||||||
* Do not remove autosaves after successfully opening a file, preventing
|
|
||||||
data loss in case of two abnormal terminations in a row.
|
|
||||||
* Do not crash when changing autosave interval.
|
|
||||||
* Unbreak the "Show degrees of freedom" command.
|
|
||||||
* Three.js: correctly respond to controls when browser zoom is used.
|
|
||||||
* OS X: do not completely hide main window when defocused.
|
|
||||||
* GTK: unbreak 3Dconnexion support.
|
|
||||||
* When pasting transformed entities, multiply constraint values by scale.
|
|
||||||
* Fix TTF font metrics (restore the behavior from version 2.0).
|
|
||||||
* Forcibly show the current group once we start a drawing operation.
|
|
||||||
* DXF export: always declare layers before using them.
|
|
||||||
* Do not truncate operations on selections to first 32 selected entities.
|
|
||||||
* Translate and rotate groups inherit the "suppress solid model" setting.
|
|
||||||
* DXF: files with paths containing non-ASCII or spaces can be exported
|
|
||||||
or imported.
|
|
||||||
* Significantly improved performance when dragging an entity.
|
|
||||||
* Various crashes and minor glitches.
|
|
||||||
|
|
||||||
2.1
|
|
||||||
---
|
|
||||||
|
|
||||||
New sketch features:
|
|
||||||
* Lathe groups create circle and face entities.
|
|
||||||
* New toolbar button for creating lathe groups.
|
|
||||||
* Chord tolerance is separated into two: display chord tolerance (specified
|
|
||||||
in percents, relative to model bounding box), and export chord tolerance
|
|
||||||
(specified in millimeters as absolute value).
|
|
||||||
* Bezier spline points can be added and removed after the spline is created.
|
|
||||||
* When an unconstrained extrusion is switched between "union" and
|
|
||||||
"difference", its normal is flipped.
|
|
||||||
* Groups can be added in the middle of the stack. Note that this results
|
|
||||||
in files incompatible with version 2.0.
|
|
||||||
* Active group can be removed.
|
|
||||||
* Removing an imported group does not cause all subsequent groups to also
|
|
||||||
be removed.
|
|
||||||
* When a new group with a solid is created, the color is taken from
|
|
||||||
a previous group with a solid, if any.
|
|
||||||
* Entities in a newly active group do not become visible.
|
|
||||||
* When entities are selected, "Zoom to fit" zooms to fit only these
|
|
||||||
entities and not the entire sketch.
|
|
||||||
* Zero-length edges are reported with a "zero-length error", not
|
|
||||||
"points not all coplanar".
|
|
||||||
|
|
||||||
New constraint features:
|
|
||||||
* Height of the font used for drawing constraint labels can be changed.
|
|
||||||
* New constraint, length difference, placed with J.
|
|
||||||
(Patch by Peter Ruevski)
|
|
||||||
* Horizontal/vertical constraints are automatically added if a line segment
|
|
||||||
is close enough to being horizontal/vertical. This can be disabled by
|
|
||||||
holding Ctrl.
|
|
||||||
* Reference dimensions and angles can be placed with Shift+D and Shift+N.
|
|
||||||
* Copying and pasting entities duplicates any constraints that only involve
|
|
||||||
entities in the clipboard, as well as selected comments.
|
|
||||||
* Diameter constraints can be shown as radius.
|
|
||||||
* The "pi" identifier can be used in expressions.
|
|
||||||
* Constraint labels can be snapped to grid.
|
|
||||||
* Integer angles are displayed without trailing zeroes.
|
|
||||||
* Angle constraints have proper reference lines and arrowheads.
|
|
||||||
* Extension lines are drawn for point-line distance constraints.
|
|
||||||
|
|
||||||
New solver features:
|
|
||||||
* Sketches with redundant and unsolvable constraints are distinguished.
|
|
||||||
* New group setting, "allow redundant constraints". Note that it makes
|
|
||||||
the solver less stable.
|
|
||||||
|
|
||||||
New rendering and styling features:
|
|
||||||
* New line style parameter: stippling, based on ISO 128.
|
|
||||||
* Outlines of solids can be drawn in a particular style (by default, thick
|
|
||||||
lines) controlled by the "Show outline of solid model" button.
|
|
||||||
* Occluded edges can be drawn in a particular style (by default, stippled
|
|
||||||
with short dashes) controlled by the "Show hidden lines" button.
|
|
||||||
* Solids can be made transparent.
|
|
||||||
|
|
||||||
New export/import features:
|
|
||||||
* The old "import" command (for .slvs files) is renamed to "link".
|
|
||||||
* If a linked .slvs file is not found, first the relative path recorded
|
|
||||||
in the .slvs file is checked and then the absolute path; this is
|
|
||||||
an inversion of the previously used order. If it is still not found,
|
|
||||||
a dialog appears offering to locate it.
|
|
||||||
* DXF and DWG files can be imported, with point-coincident, horizontal and
|
|
||||||
vertical constraints automatically inferred from geometry, and distance
|
|
||||||
and angle constraints created when a dimension placed against geometry
|
|
||||||
exists.
|
|
||||||
* Triangle mesh can be exported for viewing in the browser through WebGL.
|
|
||||||
* Export dialogs remember the last file format used, and preselect it.
|
|
||||||
* Exported DXF files have exact circles, arcs and splines instead of
|
|
||||||
a piecewise linear approximation (unless hidden line removal was needed).
|
|
||||||
* Exported DXF files preserve color and line thickness.
|
|
||||||
* In exported DXF files, constraints are represented as DXF dimensions,
|
|
||||||
instead of piecewise linear geometry.
|
|
||||||
* When exporting 2d views, overlapping lines are removed.
|
|
||||||
|
|
||||||
Other new features:
|
|
||||||
* Native Linux (GTK 2 and GTK 3) and Mac OS X ports.
|
|
||||||
* Automatically save and then restore sketches if SolveSpace crashes.
|
|
||||||
(Patch by Marc Britten)
|
|
||||||
* Unicode is supported everywhere (filenames, group names, TTF text,
|
|
||||||
comments), although RTL scripts and scripts making heavy use of ligatures
|
|
||||||
are not rendered correctly.
|
|
||||||
* The vector font is grid-fitted when rendered on screen to make it easier
|
|
||||||
to read regardless of its size.
|
|
||||||
|
|
||||||
2.0
|
|
||||||
---
|
|
||||||
|
|
||||||
Initial public release.
|
|
239
CMakeLists.txt
|
@ -1,230 +1,23 @@
|
||||||
# cmake configuration
|
# cmake configuration
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"In-tree builds are not supported; please perform an out-of-tree build:\n"
|
|
||||||
" rm -rf CMakeCache.txt CMakeFiles/\n"
|
|
||||||
" mkdir build && cd build && cmake ..")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||||
cmake_policy(VERSION 3.1.0)
|
cmake_policy(VERSION 3.1.0)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
|
||||||
"${CMAKE_SOURCE_DIR}/cmake/")
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
||||||
|
|
||||||
# for /MT on MSVC
|
|
||||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE
|
|
||||||
"${CMAKE_SOURCE_DIR}/cmake/c_flag_overrides.cmake")
|
|
||||||
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
|
|
||||||
"${CMAKE_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake")
|
|
||||||
|
|
||||||
# project
|
# project
|
||||||
|
|
||||||
# NOTE TO PACKAGERS: The embedded git commit hash is critical for rapid bug triage when the builds
|
|
||||||
# can come from a variety of sources. If you are mirroring the sources or otherwise build when
|
|
||||||
# the .git directory is not present, please comment the following line:
|
|
||||||
include(GetGitCommitHash)
|
|
||||||
# and instead uncomment the following, adding the complete git hash of the checkout you are using:
|
|
||||||
# set(GIT_COMMIT_HASH 0000000000000000000000000000000000000000)
|
|
||||||
|
|
||||||
project(solvespace)
|
project(solvespace)
|
||||||
set(solvespace_VERSION_MAJOR 3)
|
|
||||||
set(solvespace_VERSION_MINOR 0)
|
|
||||||
string(SUBSTRING "${GIT_COMMIT_HASH}" 0 8 solvespace_GIT_HASH)
|
|
||||||
|
|
||||||
set(ENABLE_GUI ON CACHE BOOL
|
|
||||||
"Whether the graphical interface is enabled (command line interface always is)")
|
|
||||||
set(ENABLE_TESTS ON CACHE BOOL
|
|
||||||
"Whether the test suite will be built and run")
|
|
||||||
set(ENABLE_COVERAGE OFF CACHE BOOL
|
|
||||||
"Whether code coverage information will be collected")
|
|
||||||
set(ENABLE_SANITIZERS OFF CACHE BOOL
|
|
||||||
"Whether to enable Clang's AddressSanitizer and UndefinedBehaviorSanitizer")
|
|
||||||
|
|
||||||
set(OPENGL 2 CACHE STRING "OpenGL version to use (one of: 1 2)")
|
|
||||||
|
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
||||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
||||||
|
|
||||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL CMAKE_CXX_COMPILER_ID)
|
|
||||||
message(FATAL_ERROR "C and C++ compilers should be supplied by the same vendor")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
|
||||||
# GCC 4.8/4.9 ship with broken but present <regex>. meh.
|
|
||||||
message(FATAL_ERROR "GCC 5.0+ is required")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# common compiler flags
|
# common compiler flags
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
||||||
|
|
||||||
if(TRIPLE STREQUAL "i686-w64-mingw32")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_EXE_LINKER_FLAGS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_SANITIZERS)
|
|
||||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||||||
message(FATAL_ERROR "Sanitizers are only available when using Clang/Clang++")
|
|
||||||
endif()
|
|
||||||
set(SANITIZE_FLAGS "-O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
|
||||||
set(SANITIZE_FLAGS "${SANITIZE_FLAGS} -fsanitize=address,integer")
|
|
||||||
set(SANITIZE_FLAGS "${SANITIZE_FLAGS} -fno-sanitize-recover=integer")
|
|
||||||
# We assume IEEE floats, which means DIV/0 is defined; but ubsan doesn't do so by default.
|
|
||||||
set(SANITIZE_FLAGS "${SANITIZE_FLAGS} -fno-sanitize=float-divide-by-zero")
|
|
||||||
set(SANITIZE_FLAGS "${SANITIZE_FLAGS} -fno-sanitize=unsigned-integer-overflow")
|
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZE_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
|
|
||||||
message(STATUS "Using in-tree libdxfrw")
|
|
||||||
add_subdirectory(extlib/libdxfrw)
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
include(FindVendoredPackage)
|
|
||||||
include(AddVendoredSubdirectory)
|
|
||||||
|
|
||||||
find_vendored_package(Freetype freetype
|
|
||||||
WITH_ZLIB OFF
|
|
||||||
WITH_BZip2 OFF
|
|
||||||
WITH_PNG OFF
|
|
||||||
WITH_HarfBuzz OFF
|
|
||||||
FREETYPE_LIBRARY freetype
|
|
||||||
FREETYPE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/freetype/include)
|
|
||||||
|
|
||||||
find_vendored_package(ZLIB zlib
|
|
||||||
ZLIB_LIBRARY zlibstatic
|
|
||||||
ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/zlib)
|
|
||||||
list(APPEND ZLIB_INCLUDE_DIR ${CMAKE_BINARY_DIR}/extlib/zlib)
|
|
||||||
|
|
||||||
find_vendored_package(PNG libpng
|
|
||||||
SKIP_INSTALL_ALL ON
|
|
||||||
PNG_LIBRARY png_static
|
|
||||||
PNG_PNG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/libpng)
|
|
||||||
list(APPEND PNG_PNG_INCLUDE_DIR ${CMAKE_BINARY_DIR}/extlib/libpng)
|
|
||||||
|
|
||||||
message(STATUS "Using in-tree pixman")
|
|
||||||
add_vendored_subdirectory(extlib/pixman)
|
|
||||||
set(PIXMAN_FOUND YES)
|
|
||||||
set(PIXMAN_LIBRARY pixman)
|
|
||||||
set(PIXMAN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/pixman/pixman)
|
|
||||||
list(APPEND PIXMAN_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/pixman/pixman)
|
|
||||||
|
|
||||||
message(STATUS "Using in-tree cairo")
|
|
||||||
add_vendored_subdirectory(extlib/cairo)
|
|
||||||
set(CAIRO_FOUND YES)
|
|
||||||
set(CAIRO_LIBRARIES cairo)
|
|
||||||
set(CAIRO_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/cairo/src)
|
|
||||||
list(APPEND CAIRO_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/extlib/cairo/src)
|
|
||||||
|
|
||||||
if(ENABLE_GUI)
|
|
||||||
if(OPENGL STREQUAL "2")
|
|
||||||
message(STATUS "Using in-tree ANGLE")
|
|
||||||
set(ANGLE_STATIC ON CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_D3D9 ON CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_D3D11 ON CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_OPENGL OFF CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_ESSL OFF CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_GLSL OFF CACHE INTERNAL "")
|
|
||||||
set(ANGLE_ENABLE_HLSL ON CACHE INTERNAL "")
|
|
||||||
add_vendored_subdirectory(extlib/angle)
|
|
||||||
set(OPENGL_LIBRARIES EGL GLESv2)
|
|
||||||
set(OPENGL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/angle/include)
|
|
||||||
else()
|
|
||||||
find_package(OpenGL REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
|
|
||||||
message(STATUS "Using prebuilt SpaceWare")
|
|
||||||
set(SPACEWARE_FOUND TRUE)
|
|
||||||
set(SPACEWARE_INCLUDE_DIR
|
|
||||||
"${CMAKE_SOURCE_DIR}/extlib/si")
|
|
||||||
set(SPACEWARE_LIBRARIES
|
|
||||||
"${CMAKE_SOURCE_DIR}/extlib/si/siapp.lib")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
elseif(APPLE)
|
|
||||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
|
||||||
|
|
||||||
find_package(ZLIB REQUIRED)
|
|
||||||
find_package(PNG REQUIRED)
|
|
||||||
find_package(Freetype REQUIRED)
|
|
||||||
|
|
||||||
find_library(CAIRO_LIBRARIES cairo REQUIRED)
|
|
||||||
find_path(CAIRO_INCLUDE_DIRS cairo.h PATH_SUFFIXES cairo)
|
|
||||||
|
|
||||||
if(ENABLE_GUI)
|
|
||||||
find_package(OpenGL REQUIRED)
|
|
||||||
find_library(APPKIT_LIBRARY AppKit REQUIRED)
|
|
||||||
endif()
|
|
||||||
else() # Linux and compatible systems
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
|
|
||||||
find_package(Backtrace)
|
|
||||||
find_package(SpaceWare)
|
|
||||||
|
|
||||||
find_package(ZLIB REQUIRED)
|
|
||||||
find_package(PNG REQUIRED)
|
|
||||||
find_package(Freetype REQUIRED)
|
|
||||||
pkg_check_modules(CAIRO REQUIRED cairo)
|
|
||||||
|
|
||||||
if(ENABLE_GUI)
|
|
||||||
find_package(OpenGL REQUIRED)
|
|
||||||
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
|
|
||||||
pkg_check_modules(JSONC REQUIRED json-c)
|
|
||||||
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.16 pangomm-1.4 x11)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_COVERAGE)
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
|
||||||
find_program(GCOV gcov)
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
|
||||||
find_program(LLVM_COV llvm-cov)
|
|
||||||
|
|
||||||
if(LLVM_COV)
|
|
||||||
set(GCOV ${CMAKE_CURRENT_BINARY_DIR}/llvm-gcov.sh)
|
|
||||||
file(WRITE ${GCOV} "#!/bin/sh -e\n${LLVM_COV} gcov $*")
|
|
||||||
execute_process(COMMAND chmod +x ${GCOV})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_program(LCOV lcov)
|
|
||||||
find_program(GENHTML genhtml)
|
|
||||||
if(NOT GCOV OR NOT LCOV OR NOT GENHTML)
|
|
||||||
message(FATAL_ERROR "gcov/llvm-cov and lcov are required for producing coverage reports")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_program(XGETTEXT xgettext)
|
|
||||||
find_program(MSGINIT msginit)
|
|
||||||
find_program(MSGMERGE msgmerge)
|
|
||||||
if(XGETTEXT AND MSGINIT AND MSGMERGE)
|
|
||||||
set(HAVE_GETTEXT TRUE)
|
|
||||||
else()
|
|
||||||
message(WARNING "Gettext not found, translations will not be updated")
|
|
||||||
set(HAVE_GETTEXT FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# solvespace-only compiler flags
|
# solvespace-only compiler flags
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -232,8 +25,7 @@ if(WIN32)
|
||||||
-D_CRT_SECURE_NO_DEPRECATE
|
-D_CRT_SECURE_NO_DEPRECATE
|
||||||
-D_CRT_SECURE_NO_WARNINGS
|
-D_CRT_SECURE_NO_WARNINGS
|
||||||
-D_SCL_SECURE_NO_WARNINGS
|
-D_SCL_SECURE_NO_WARNINGS
|
||||||
-DWINVER=0x0601
|
-D_WIN32_WINNT=0x500
|
||||||
-D_WIN32_WINNT=0x0601
|
|
||||||
-D_WIN32_IE=_WIN32_WINNT
|
-D_WIN32_IE=_WIN32_WINNT
|
||||||
-DISOLATION_AWARE_ENABLED
|
-DISOLATION_AWARE_ENABLED
|
||||||
-DWIN32
|
-DWIN32
|
||||||
|
@ -269,36 +61,7 @@ endif()
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -l0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_COVERAGE)
|
|
||||||
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
|
|
||||||
CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
||||||
message(FATAL_ERROR "Code coverage is only available on GCC and Clang")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
message(FATAL_ERROR "Code coverage produces reliable results only on Debug builds")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# With -fexceptions, every call becomes a branch. While technically accurate,
|
|
||||||
# this is not useful for us.
|
|
||||||
set(COVERAGE_FLAGS -fno-exceptions --coverage)
|
|
||||||
set(COVERAGE_LIBRARY --coverage)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# components
|
# components
|
||||||
|
|
||||||
add_subdirectory(res)
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(exposed)
|
add_subdirectory(exposed)
|
||||||
if(ENABLE_TESTS)
|
|
||||||
add_subdirectory(test)
|
|
||||||
endif()
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
||||||
add_subdirectory(bench)
|
|
||||||
else()
|
|
||||||
message(STATUS "Benchmarking disabled in debug builds.")
|
|
||||||
endif()
|
|
||||||
|
|
250
CONTRIBUTING.md
|
@ -1,250 +0,0 @@
|
||||||
Contributing to SolveSpace
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Contributing bug reports
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
Bug reports are always welcome! When reporting a bug, please include the following:
|
|
||||||
|
|
||||||
* The version of SolveSpace (use Help → About...);
|
|
||||||
* The operating system;
|
|
||||||
* The save file that reproduces the incorrect behavior, or, if trivial or impossible,
|
|
||||||
instructions for reproducing it.
|
|
||||||
|
|
||||||
GitHub does not allow attaching `*.slvs` files, but it does allow attaching `*.zip` files,
|
|
||||||
so any savefiles should first be archived.
|
|
||||||
|
|
||||||
Contributing code
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
SolveSpace is written in C++, and currently targets all compilers compliant with C++11.
|
|
||||||
This includes GCC 5 and later, Clang 3.3 and later, and Visual Studio 12 (2013) and later.
|
|
||||||
|
|
||||||
### High-level conventions
|
|
||||||
|
|
||||||
#### Portability
|
|
||||||
|
|
||||||
SolveSpace aims to consist of two general parts: a fully portable core, and platform-specific
|
|
||||||
UI and support code. Anything outside of `src/platform/` should only use standard C++11,
|
|
||||||
and rely on `src/platform/unixutil.cpp` and `src/platform/w32util.cpp` to interact with
|
|
||||||
the OS where this cannot be done through the C++11 standard library.
|
|
||||||
|
|
||||||
#### Libraries
|
|
||||||
|
|
||||||
SolveSpace primarily relies on the C++11 STL. STL has well-known drawbacks, but is also
|
|
||||||
widely supported, used, and understood. SolveSpace also includes a fair amount of use of
|
|
||||||
bespoke containers List and IdList; these provide STL iterators, and can be used when
|
|
||||||
convenient, such as when reusing other code.
|
|
||||||
|
|
||||||
One notable departure here is the STL I/O threads. SolveSpace does not use STL I/O threads
|
|
||||||
for two reasons: (i) the interface is borderline unusable, and (ii) on Windows it is not
|
|
||||||
possible to open files with Unicode paths through STL.
|
|
||||||
|
|
||||||
When using external libraries (other than to access platform features), the libraries
|
|
||||||
should satisfy the following conditions:
|
|
||||||
|
|
||||||
* Portable, and preferably not interacting with the platform at all;
|
|
||||||
* Can be included as a CMake subproject, to facilitate Windows, Android, etc. builds;
|
|
||||||
* Use a license less restrictive than GPL (BSD/MIT, Apache2, MPL, etc.)
|
|
||||||
|
|
||||||
#### String encoding
|
|
||||||
|
|
||||||
Internally, SolveSpace exclusively stores and uses UTF-8 for all purposes; any `std::string`
|
|
||||||
may be assumed to be encoded in UTF-8. On Windows, UTF-8 strings are converted to and from
|
|
||||||
wide strings at the boundary; see [UTF-8 Everywhere][utf8] for details.
|
|
||||||
|
|
||||||
[utf8]: http://utf8everywhere.org/
|
|
||||||
|
|
||||||
#### String formatting
|
|
||||||
|
|
||||||
For string formatting, a wrapper around `sprintf`, `ssprintf`, is used. A notable
|
|
||||||
pitfall when using it is trying to pass an `std::string` argument without first converting
|
|
||||||
it to a C string with `.c_str()`.
|
|
||||||
|
|
||||||
#### Filesystem access
|
|
||||||
|
|
||||||
For filesystem access, the C standard library is used. The `ssfopen` and `ssremove`
|
|
||||||
wrappers are provided that accept UTF-8 encoded paths.
|
|
||||||
|
|
||||||
#### Assertions
|
|
||||||
|
|
||||||
To ensure that internal invariants hold, the `ssassert` function is used, e.g.
|
|
||||||
`ssassert(!isFoo, "Unexpected foo condition");`. Unlike the standard `assert` function,
|
|
||||||
the `ssassert` function is always enabled, even in release builds. It is more valuable
|
|
||||||
to discover a bug through a crash than to silently generate incorrect results, and crashes
|
|
||||||
do not result in losing more than a few minutes of work thanks to the autosave feature.
|
|
||||||
|
|
||||||
### Use of C++ features
|
|
||||||
|
|
||||||
The conventions described in this section should be used for all new code, but there is a lot
|
|
||||||
of existing code in SolveSpace that does not use them. This is fine; don't touch it if it works,
|
|
||||||
but if you need to modify it anyway, might as well modernize it.
|
|
||||||
|
|
||||||
#### Exceptions
|
|
||||||
|
|
||||||
Exceptions are not used primarily because SolveSpace's testsuite uses measurement
|
|
||||||
of branch coverage, important for the critical parts such as the geometric kernel.
|
|
||||||
Every function call with exceptions enabled introduces a branch, making branch coverage
|
|
||||||
measurement useless.
|
|
||||||
|
|
||||||
#### Operator overloading
|
|
||||||
|
|
||||||
Operator overloading is not used primarily for historical reasons. Instead, method such
|
|
||||||
as `Plus` are used.
|
|
||||||
|
|
||||||
#### Member visibility
|
|
||||||
|
|
||||||
Member visibility is not used for implementation hiding. Every member field and function
|
|
||||||
is `public`.
|
|
||||||
|
|
||||||
#### Constructors
|
|
||||||
|
|
||||||
Constructors are not used for initialization, chiefly because indicating an error
|
|
||||||
in a constructor would require throwing an exception, nor does it use constructors for
|
|
||||||
blanket zero-initialization because of the performance impact of doing this for common
|
|
||||||
POD classes like `Vector`.
|
|
||||||
|
|
||||||
Instances can be zero-initialized using the aggregate-initialization syntax, e.g. `Foo foo = {};`.
|
|
||||||
This zero-initializes the POD members and default-initializes the non-POD members, generally
|
|
||||||
being an equivalent of `memset(&foo, 0, sizeof(foo));` but compatible with STL containers.
|
|
||||||
|
|
||||||
#### Input- and output-arguments
|
|
||||||
|
|
||||||
Functions accepting an input argument take it either by-value (`Vector v`) or
|
|
||||||
by-const-reference (`const Vector &v`). Generally, passing by-value is safer as the value
|
|
||||||
cannot be aliased by something else, but passing by-const-reference is faster, as a copy is
|
|
||||||
eliminated. Small values should always be passed by-value, and otherwise functions that do not
|
|
||||||
capture pointers into their arguments should take them by-const-reference. Use your judgement.
|
|
||||||
|
|
||||||
Functions accepting an output argument always take it by-pointer (`Vector *v`). This makes
|
|
||||||
it immediately visible at the call site as it is seen that the address is taken. Arguments
|
|
||||||
are never passed by-reference, except when needed for interoperability with STL, etc.
|
|
||||||
|
|
||||||
#### Iteration
|
|
||||||
|
|
||||||
`foreach`-style iteration is preferred for both STL and `List`/`IdList` containers as it indicates
|
|
||||||
intent clearly, as opposed to `for`-style.
|
|
||||||
|
|
||||||
#### Const correctness
|
|
||||||
|
|
||||||
Functions that do not mutate `this` should be marked as `const`; when iterating a collection
|
|
||||||
without mutating any of its elements, `for(const Foo &elem : collection)` is preferred to indicate
|
|
||||||
the intent.
|
|
||||||
|
|
||||||
### Coding style
|
|
||||||
|
|
||||||
Code is formatted by the following rules:
|
|
||||||
|
|
||||||
* Code is indented using 4 spaces, with no trailing spaces, and lines are wrapped
|
|
||||||
at 100 columns;
|
|
||||||
* Braces are placed at the end of the line with the declaration or control flow statement;
|
|
||||||
* Braces are used with every control flow statement, even if there is only one statement
|
|
||||||
in the body;
|
|
||||||
* There is no space after control flow keywords (`if`, `while`, etc.);
|
|
||||||
* Identifiers are formatted in camel case; variables start with a lowercase letter
|
|
||||||
(`exampleVariable`) and functions start with an uppercase letter (`ExampleFunction`).
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```c++
|
|
||||||
std::string SolveSpace::Dirname(std::string filename) {
|
|
||||||
int slash = filename.rfind(PATH_SEP);
|
|
||||||
if(slash >= 0) {
|
|
||||||
return filename.substr(0, slash);
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Debugging code
|
|
||||||
--------------
|
|
||||||
|
|
||||||
SolveSpace releases are throughly tested but sometimes they contain crash
|
|
||||||
bugs anyway. The reason for such crashes can be determined only if the executable
|
|
||||||
was built with debug information.
|
|
||||||
|
|
||||||
### Debugging a released version
|
|
||||||
|
|
||||||
The Linux distributions usually include separate debug information packages.
|
|
||||||
On a Debian derivative (e.g. Ubuntu), these can be installed with:
|
|
||||||
|
|
||||||
apt-get install solvespace-dbg
|
|
||||||
|
|
||||||
The macOS releases include the debug information, and no further action
|
|
||||||
is needed.
|
|
||||||
|
|
||||||
The Windows releases include the debug information on the GitHub
|
|
||||||
[release downloads page](https://github.com/solvespace/solvespace/releases).
|
|
||||||
|
|
||||||
### Debugging a custom build
|
|
||||||
|
|
||||||
If you are building SolveSpace yourself on a Unix-like platform,
|
|
||||||
configure or re-configure SolveSpace to produce a debug build, and
|
|
||||||
then re-build it:
|
|
||||||
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Debug [other cmake args...]
|
|
||||||
make
|
|
||||||
|
|
||||||
If you are building SolveSpace yourself using the Visual Studio IDE,
|
|
||||||
select Debug from the Solution Configurations list box on the toolbar,
|
|
||||||
and build the solution.
|
|
||||||
|
|
||||||
### Debugging with gdb
|
|
||||||
|
|
||||||
gdb is a debugger that is mostly used on Linux. First, run SolveSpace
|
|
||||||
under debugging:
|
|
||||||
|
|
||||||
gdb [path to solvespace executable]
|
|
||||||
(gdb) run
|
|
||||||
|
|
||||||
Then, reproduce the crash. After the crash, attach the output in
|
|
||||||
the console, as well as output of the following gdb commands to
|
|
||||||
a bug report:
|
|
||||||
|
|
||||||
(gdb) backtrace
|
|
||||||
(gdb) info locals
|
|
||||||
|
|
||||||
If the crash is not easy to reproduce, please generate a core file,
|
|
||||||
which you can use to resume the debugging session later, and provide
|
|
||||||
any other information that is requested:
|
|
||||||
|
|
||||||
(gdb) generate-core-file
|
|
||||||
|
|
||||||
This will generate a large file called like `core.1234` in the current
|
|
||||||
directory; it can be later re-loaded using `gdb --core core.1234`.
|
|
||||||
|
|
||||||
### Debugging with lldb
|
|
||||||
|
|
||||||
lldb is a debugger that is mostly used on macOS. First, run SolveSpace
|
|
||||||
under debugging:
|
|
||||||
|
|
||||||
lldb [path to solvespace executable]
|
|
||||||
(lldb) run
|
|
||||||
|
|
||||||
Then, reproduce the crash. After the crash, attach the output in
|
|
||||||
the console, as well as output of the following gdb commands to
|
|
||||||
a bug report:
|
|
||||||
|
|
||||||
(lldb) backtrace all
|
|
||||||
(lldb) frame variable
|
|
||||||
|
|
||||||
If the crash is not easy to reproduce, please generate a core file,
|
|
||||||
which you can use to resume the debugging session later, and provide
|
|
||||||
any other information that is requested:
|
|
||||||
|
|
||||||
(lldb) process save-core "core"
|
|
||||||
|
|
||||||
This will generate a large file called `core` in the current
|
|
||||||
directory; it can be later re-loaded using `lldb -c core`.
|
|
||||||
|
|
||||||
### Debugging GUI-related bugs on Linux
|
|
||||||
|
|
||||||
There are several environment variables available that make crashes
|
|
||||||
earlier and errors more informative. Before running SolveSpace, run
|
|
||||||
the following commands in your shell:
|
|
||||||
|
|
||||||
export G_DEBUG=fatal_warnings
|
|
||||||
export LIBGL_DEBUG=1
|
|
||||||
export MESA_DEBUG=1
|
|
164
README.md
|
@ -1,164 +0,0 @@
|
||||||
SolveSpace
|
|
||||||
==========
|
|
||||||
|
|
||||||
This repository contains the source code of [SolveSpace][], a parametric
|
|
||||||
2d/3d CAD.
|
|
||||||
|
|
||||||
[solvespace]: http://solvespace.com
|
|
||||||
|
|
||||||
Installation
|
|
||||||
------------
|
|
||||||
|
|
||||||
### macOS (>=10.6 64-bit), Windows (>=Vista 32-bit)
|
|
||||||
|
|
||||||
Binary packages for macOS and Windows are available via
|
|
||||||
[GitHub releases][rel].
|
|
||||||
|
|
||||||
[rel]: https://github.com/solvespace/solvespace/releases
|
|
||||||
|
|
||||||
### Other systems
|
|
||||||
|
|
||||||
See below.
|
|
||||||
|
|
||||||
Building on Linux
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
### Building for Linux
|
|
||||||
|
|
||||||
You will need CMake, zlib, libpng, cairo, freetype. To build the GUI, you will need
|
|
||||||
fontconfig, gtkmm 3.0 (version 3.16 or later), pangomm 1.4, OpenGL and OpenGL GLU, and
|
|
||||||
optionally, the Space Navigator client library.
|
|
||||||
On a Debian derivative (e.g. Ubuntu) these can be installed with:
|
|
||||||
|
|
||||||
apt-get install cmake zlib1g-dev libpng-dev libcairo2-dev libfreetype6-dev
|
|
||||||
apt-get install libjson-c-dev libfontconfig1-dev libgtkmm-3.0-dev libpangomm-1.4-dev \
|
|
||||||
libgl-dev libglu-dev libspnav-dev
|
|
||||||
|
|
||||||
Before building, check out the necessary submodules:
|
|
||||||
|
|
||||||
git submodule update --init extlib/libdxfrw
|
|
||||||
|
|
||||||
After that, build SolveSpace as following:
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
The graphical interface is built as `build/bin/solvespace`, and the command-line interface
|
|
||||||
is built as `build/bin/solvespace-cli`. It is possible to build only the command-line interface
|
|
||||||
by passing the `-DENABLE_GUI=OFF` flag to the cmake invocation.
|
|
||||||
|
|
||||||
### Building for Windows
|
|
||||||
|
|
||||||
You will need CMake and a Windows cross-compiler.
|
|
||||||
On a Debian derivative (e.g. Ubuntu) these can be installed with:
|
|
||||||
|
|
||||||
apt-get install cmake mingw-w64
|
|
||||||
|
|
||||||
Before building, check out the necessary submodules:
|
|
||||||
|
|
||||||
git submodule update --init
|
|
||||||
|
|
||||||
After that, build 32-bit SolveSpace as following:
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
|
|
||||||
Or, build 64-bit SolveSpace as following:
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
|
|
||||||
The graphical interface is built as `build/bin/solvespace.exe`, and the command-line interface
|
|
||||||
is built as `build/bin/solvespace-cli.exe`.
|
|
||||||
|
|
||||||
Space Navigator support will not be available.
|
|
||||||
|
|
||||||
Building on macOS
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
You will need XCode tools, CMake, libpng and Freetype. To build tests, you
|
|
||||||
will need cairo. Assuming you use
|
|
||||||
[homebrew][], these can be installed with:
|
|
||||||
|
|
||||||
brew install cmake libpng freetype cairo
|
|
||||||
|
|
||||||
XCode has to be installed via AppStore; it requires a free Apple ID.
|
|
||||||
|
|
||||||
Before building, check out the necessary submodules:
|
|
||||||
|
|
||||||
git submodule update --init extlib/libdxfrw
|
|
||||||
|
|
||||||
After that, build SolveSpace as following:
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
|
|
||||||
The application is built in `build/bin/solvespace.app`, the graphical interface executable
|
|
||||||
is `build/bin/solvespace.app/Contents/MacOS/solvespace`, and the command-line interface executable
|
|
||||||
is `build/bin/solvespace.app/Contents/MacOS/solvespace-cli`.
|
|
||||||
|
|
||||||
[homebrew]: http://brew.sh/
|
|
||||||
|
|
||||||
Building on Windows
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
You will need [git][gitwin], [cmake][cmakewin] and Visual C++.
|
|
||||||
|
|
||||||
### Building with Visual Studio IDE
|
|
||||||
|
|
||||||
Check out the git submodules. Create a directory `build` in
|
|
||||||
the source tree and point cmake-gui to the source tree and that directory.
|
|
||||||
Press "Configure" and "Generate", then open `build\solvespace.sln` with
|
|
||||||
Visual C++ and build it.
|
|
||||||
|
|
||||||
### Building with Visual Studio in a command prompt
|
|
||||||
|
|
||||||
First, ensure that git and cl (the Visual C++ compiler driver) are in your
|
|
||||||
`%PATH%`; the latter is usually done by invoking `vcvarsall.bat` from your
|
|
||||||
Visual Studio install. Then, run the following in cmd or PowerShell:
|
|
||||||
|
|
||||||
git submodule update --init
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
|
|
||||||
nmake
|
|
||||||
|
|
||||||
### Building with MinGW
|
|
||||||
|
|
||||||
It is also possible to build SolveSpace using [MinGW][mingw], though
|
|
||||||
Space Navigator support will be disabled.
|
|
||||||
|
|
||||||
First, ensure that git and gcc are in your `$PATH`. Then, run the following
|
|
||||||
in bash:
|
|
||||||
|
|
||||||
git submodule update --init
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
||||||
make
|
|
||||||
|
|
||||||
[gitwin]: https://git-scm.com/download/win
|
|
||||||
[cmakewin]: http://www.cmake.org/download/#latest
|
|
||||||
[mingw]: http://www.mingw.org/
|
|
||||||
|
|
||||||
Contributing
|
|
||||||
------------
|
|
||||||
|
|
||||||
See the [guide for contributors](CONTRIBUTING.md) for the best way to file issues, contribute code,
|
|
||||||
and debug SolveSpace.
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
SolveSpace is distributed under the terms of the [GPL3 license](COPYING.txt).
|
|
30
appveyor.yml
|
@ -1,30 +0,0 @@
|
||||||
version: 3.0.{build}
|
|
||||||
clone_depth: 1
|
|
||||||
before_build:
|
|
||||||
- git submodule update --init
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- set tag=x%APPVEYOR_REPO_TAG_NAME%
|
|
||||||
- if %tag:~,2% == xv (set BUILD_TYPE=RelWithDebInfo) else (set BUILD_TYPE=Debug)
|
|
||||||
- cmake -G"Visual Studio 12" -T v120 ..
|
|
||||||
build_script:
|
|
||||||
- msbuild "src\solvespace.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
|
||||||
- msbuild "src\solvespace-cli.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
|
||||||
- msbuild "test\solvespace-testsuite.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
|
||||||
test_script:
|
|
||||||
- bin\%BUILD_TYPE%\solvespace-testsuite.exe
|
|
||||||
artifacts:
|
|
||||||
- path: build\bin\%BUILD_TYPE%\solvespace.exe
|
|
||||||
name: solvespace.exe
|
|
||||||
- path: build\bin\%BUILD_TYPE%\solvespace-cli.exe
|
|
||||||
name: solvespace-cli.exe
|
|
||||||
- path: build\bin\%BUILD_TYPE%\solvespace.pdb
|
|
||||||
name: solvespace.pdb
|
|
||||||
deploy:
|
|
||||||
- provider: GitHub
|
|
||||||
auth_token:
|
|
||||||
secure: P9/pf2nM+jlWKe7pCjMp41HycBNP/+5AsmE/TETrDUoBOa/9WFHelqdVFrbRn9IC
|
|
||||||
description: ""
|
|
||||||
artifact: solvespace.exe,solvespace-cli.exe,solvespace.pdb
|
|
||||||
on:
|
|
||||||
appveyor_repo_tag: true
|
|
|
@ -1,17 +0,0 @@
|
||||||
# benchmark runner
|
|
||||||
|
|
||||||
foreach(pkg_config_lib CAIRO)
|
|
||||||
include_directories(${${pkg_config_lib}_INCLUDE_DIRS})
|
|
||||||
link_directories(${${pkg_config_lib}_LIBRARY_DIRS})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_executable(solvespace-benchmark
|
|
||||||
harness.cpp
|
|
||||||
$<TARGET_PROPERTY:resources,EXTRA_SOURCES>)
|
|
||||||
|
|
||||||
target_link_libraries(solvespace-benchmark
|
|
||||||
solvespace-core
|
|
||||||
solvespace-headless)
|
|
||||||
|
|
||||||
add_dependencies(solvespace-benchmark
|
|
||||||
resources)
|
|
|
@ -1,78 +0,0 @@
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Our harness for running benchmarks.
|
|
||||||
//
|
|
||||||
// Copyright 2016 whitequark
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
#include "solvespace.h"
|
|
||||||
|
|
||||||
static bool RunBenchmark(std::function<void()> setupFn,
|
|
||||||
std::function<bool()> benchFn,
|
|
||||||
std::function<void()> teardownFn,
|
|
||||||
size_t minIter = 5, double minTime = 5.0) {
|
|
||||||
// Warmup
|
|
||||||
setupFn();
|
|
||||||
if(!benchFn()) {
|
|
||||||
fprintf(stderr, "Benchmark failed\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
teardownFn();
|
|
||||||
|
|
||||||
// Benchmark
|
|
||||||
size_t iter = 0;
|
|
||||||
double time = 0.0;
|
|
||||||
while(iter < minIter || time < minTime) {
|
|
||||||
setupFn();
|
|
||||||
auto testStartTime = std::chrono::steady_clock::now();
|
|
||||||
benchFn();
|
|
||||||
auto testEndTime = std::chrono::steady_clock::now();
|
|
||||||
teardownFn();
|
|
||||||
|
|
||||||
std::chrono::duration<double> testTime = testEndTime - testStartTime;
|
|
||||||
time += testTime.count();
|
|
||||||
iter += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Report
|
|
||||||
fprintf(stdout, "Iterations: %zd\n", iter);
|
|
||||||
fprintf(stdout, "Time: %.3f s\n", time);
|
|
||||||
fprintf(stdout, "Per iter.: %.3f s\n", time / (double)iter);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
std::vector<std::string> args = InitPlatform(argc, argv);
|
|
||||||
|
|
||||||
std::string mode;
|
|
||||||
Platform::Path filename;
|
|
||||||
if(args.size() == 3) {
|
|
||||||
mode = args[1];
|
|
||||||
filename = Platform::Path::From(args[2]);
|
|
||||||
} else {
|
|
||||||
fprintf(stderr, "Usage: %s [mode] [filename]\n", args[0].c_str());
|
|
||||||
fprintf(stderr, "Mode can be one of: load.\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool result = false;
|
|
||||||
if(mode == "load") {
|
|
||||||
result = RunBenchmark(
|
|
||||||
[] {
|
|
||||||
SS.Init();
|
|
||||||
},
|
|
||||||
[&] {
|
|
||||||
if(!SS.LoadFromFile(filename))
|
|
||||||
return false;
|
|
||||||
SS.AfterNewFile();
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
[] {
|
|
||||||
SK.Clear();
|
|
||||||
SS.Clear();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
fprintf(stderr, "Unknown mode \"%s\"\n", mode.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return (result == true ? 0 : 1);
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Equivalent to add_subdirectory(... EXCLUDE_FROM_ALL), but also disables
|
|
||||||
# all warnings.
|
|
||||||
|
|
||||||
include(DisableWarnings)
|
|
||||||
|
|
||||||
function(add_vendored_subdirectory PATH)
|
|
||||||
disable_warnings()
|
|
||||||
|
|
||||||
add_subdirectory(${PATH} EXCLUDE_FROM_ALL)
|
|
||||||
endfunction()
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Disables all warnings on MSVC and GNU-compatible compilers.
|
|
||||||
|
|
||||||
function(disable_warnings)
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w" PARENT_SCOPE)
|
|
||||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w" PARENT_SCOPE)
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
|
@ -1,28 +0,0 @@
|
||||||
# Find the libspnav library and header.
|
|
||||||
#
|
|
||||||
# Sets the usual variables expected for find_package scripts:
|
|
||||||
#
|
|
||||||
# SPACEWARE_INCLUDE_DIR - header location
|
|
||||||
# SPACEWARE_LIBRARIES - library to link against
|
|
||||||
# SPACEWARE_FOUND - true if pugixml was found.
|
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
|
|
||||||
find_path(SPACEWARE_INCLUDE_DIR
|
|
||||||
spnav.h)
|
|
||||||
|
|
||||||
find_library(SPACEWARE_LIBRARY
|
|
||||||
NAMES spnav libspnav)
|
|
||||||
|
|
||||||
# Support the REQUIRED and QUIET arguments, and set SPACEWARE_FOUND if found.
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SPACEWARE DEFAULT_MSG
|
|
||||||
SPACEWARE_LIBRARY SPACEWARE_INCLUDE_DIR)
|
|
||||||
|
|
||||||
if(SPACEWARE_FOUND)
|
|
||||||
set(SPACEWARE_LIBRARIES ${SPACEWARE_LIBRARY})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(SPACEWARE_LIBRARY SPACEWARE_INCLUDE_DIR)
|
|
||||||
|
|
||||||
endif()
|
|
|
@ -1,54 +0,0 @@
|
||||||
# Find the given library in the system locations, or build in-tree if not found.
|
|
||||||
#
|
|
||||||
# Arguments:
|
|
||||||
# PKG_NAME - name of the package as passed to find_package
|
|
||||||
# PKG_PATH - name of the source tree relative to extlib/
|
|
||||||
#
|
|
||||||
# The rest of the arguments are VARIABLE VALUE pairs. If the library is not found,
|
|
||||||
# every VARIABLE will be set to VALUE and find_package will be rerun with the REQUIRED flag.
|
|
||||||
# Regardless of where the library was found, only the specfied VARIABLEs that start with
|
|
||||||
# ${PKG_NAME} will be set in the parent scope.
|
|
||||||
#
|
|
||||||
# All warnings in the in-tree package are disabled.
|
|
||||||
|
|
||||||
include(DisableWarnings)
|
|
||||||
|
|
||||||
function(find_vendored_package PKG_NAME PKG_PATH)
|
|
||||||
find_package(${PKG_NAME})
|
|
||||||
|
|
||||||
set(cfg_name)
|
|
||||||
foreach(item ${ARGN})
|
|
||||||
if(NOT cfg_name)
|
|
||||||
set(cfg_name ${item})
|
|
||||||
else()
|
|
||||||
set(${cfg_name} ${item} CACHE INTERNAL "")
|
|
||||||
set(cfg_name)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
disable_warnings()
|
|
||||||
|
|
||||||
string(TOUPPER ${PKG_NAME} VAR_NAME)
|
|
||||||
if(NOT ${VAR_NAME}_FOUND)
|
|
||||||
message(STATUS "Using in-tree ${PKG_PATH}")
|
|
||||||
set(${VAR_NAME}_IN_TREE YES CACHE INTERNAL "")
|
|
||||||
|
|
||||||
add_subdirectory(extlib/${PKG_PATH} EXCLUDE_FROM_ALL)
|
|
||||||
find_package(${PKG_NAME} REQUIRED)
|
|
||||||
elseif(${VAR_NAME}_IN_TREE)
|
|
||||||
add_subdirectory(extlib/${PKG_PATH} EXCLUDE_FROM_ALL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Now put everything we just discovered into the cache.
|
|
||||||
set(cfg_name)
|
|
||||||
foreach(item ${ARGN} ${VAR_NAME}_FOUND)
|
|
||||||
if(NOT cfg_name)
|
|
||||||
set(cfg_name ${item})
|
|
||||||
else()
|
|
||||||
if(cfg_name MATCHES "^${VAR_NAME}")
|
|
||||||
set(${cfg_name} "${${cfg_name}}" CACHE INTERNAL "")
|
|
||||||
endif()
|
|
||||||
set(cfg_name)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endfunction()
|
|
|
@ -1,35 +0,0 @@
|
||||||
function(get_git_commit_hash)
|
|
||||||
get_filename_component(GIT_DESCRIBE_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
|
||||||
get_filename_component(GIT_ROOT ${GIT_DESCRIBE_CMAKE_DIR} PATH)
|
|
||||||
set(GIT_DIR "${GIT_ROOT}/.git")
|
|
||||||
|
|
||||||
# Add a CMake configure dependency to the currently checked out revision.
|
|
||||||
set(GIT_DEPENDS ${GIT_DIR}/HEAD)
|
|
||||||
file(READ ${GIT_DIR}/HEAD HEAD_REF)
|
|
||||||
if(HEAD_REF MATCHES "ref: (.+)\n")
|
|
||||||
set(HEAD_REF ${CMAKE_MATCH_1})
|
|
||||||
if(EXISTS "${GIT_DIR}/${HEAD_REF}")
|
|
||||||
list(APPEND GIT_DEPENDS ${GIT_DIR}/${HEAD_REF})
|
|
||||||
file(READ ${GIT_DIR}/${HEAD_REF} HEAD_REF)
|
|
||||||
elseif(EXISTS "${GIT_DIR}/packed-refs")
|
|
||||||
list(APPEND GIT_DEPENDS ${GIT_DIR}/packed-refs)
|
|
||||||
file(READ "${GIT_DIR}/packed-refs" PACKED_REFS)
|
|
||||||
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
|
||||||
set(HEAD_REF ${CMAKE_MATCH_1})
|
|
||||||
else()
|
|
||||||
set(HEAD_REF "")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(HEAD_REF "")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${GIT_DEPENDS})
|
|
||||||
|
|
||||||
string(STRIP ${HEAD_REF} HEAD_REF)
|
|
||||||
if(HEAD_REF STREQUAL "")
|
|
||||||
message(WARNING "Cannot determine git HEAD")
|
|
||||||
else()
|
|
||||||
set(GIT_COMMIT_HASH ${HEAD_REF} PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
get_git_commit_hash()
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>solvespace</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>SolveSpace</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}~${solvespace_GIT_HASH}</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>${solvespace_VERSION_MAJOR}.${solvespace_VERSION_MINOR}</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string>© 2008-2016 Jonathan Westhues and other authors</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string>NSApplication</string>
|
|
||||||
<key>NSMainNibFile</key>
|
|
||||||
<string>MainMenu</string>
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string>AppIcon</string>
|
|
||||||
<key>CFBundleDocumentTypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleTypeExtensions</key>
|
|
||||||
<array>
|
|
||||||
<string>slvs</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleTypeIconFile</key>
|
|
||||||
<string>AppIcon.icns</string>
|
|
||||||
<key>CFBundleTypeName</key>
|
|
||||||
<string>SolveSpace sketch</string>
|
|
||||||
<key>CFBundleTypeOSTypes</key>
|
|
||||||
<array>
|
|
||||||
<string>slvs</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleTypeRole</key>
|
|
||||||
<string>Editor</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
|
@ -1,15 +0,0 @@
|
||||||
set(CMAKE_SYSTEM_NAME Windows)
|
|
||||||
|
|
||||||
set(TRIPLE i686-w64-mingw32)
|
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER ${TRIPLE}-gcc)
|
|
||||||
set(CMAKE_CXX_COMPILER ${TRIPLE}-g++)
|
|
||||||
set(CMAKE_RC_COMPILER ${TRIPLE}-windres)
|
|
||||||
|
|
||||||
set(CMAKE_FIND_ROOT_PATH /usr/${TRIPLE})
|
|
||||||
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
||||||
|
|
||||||
set(ENV{PKG_CONFIG_LIBDIR} /usr/${TRIPLE}/lib/pkgconfig)
|
|
|
@ -1,15 +0,0 @@
|
||||||
set(CMAKE_SYSTEM_NAME Windows)
|
|
||||||
|
|
||||||
set(TRIPLE x86_64-w64-mingw32)
|
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER ${TRIPLE}-gcc)
|
|
||||||
set(CMAKE_CXX_COMPILER ${TRIPLE}-g++)
|
|
||||||
set(CMAKE_RC_COMPILER ${TRIPLE}-windres)
|
|
||||||
|
|
||||||
set(CMAKE_FIND_ROOT_PATH /usr/${TRIPLE})
|
|
||||||
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
||||||
|
|
||||||
set(ENV{PKG_CONFIG_LIBDIR} /usr/${TRIPLE}/lib/pkgconfig)
|
|
|
@ -1,6 +0,0 @@
|
||||||
if(MSVC)
|
|
||||||
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
|
||||||
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
|
|
||||||
endif()
|
|
|
@ -1,6 +0,0 @@
|
||||||
if(MSVC)
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
|
|
||||||
endif()
|
|
132
exposed/CDemo.c
|
@ -1,23 +1,17 @@
|
||||||
/*-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
* Some sample code for slvs.dll. We draw some geometric entities, provide
|
// Some sample code for slvs.dll. We draw some geometric entities, provide
|
||||||
* initial guesses for their positions, and then constrain them. The solver
|
// initial guesses for their positions, and then constrain them. The solver
|
||||||
* calculates their new positions, in order to satisfy the constraints.
|
// calculates their new positions, in order to satisfy the constraints.
|
||||||
*
|
//
|
||||||
* Copyright 2008-2013 Jonathan Westhues.
|
// Copyright 2008-2013 Jonathan Westhues.
|
||||||
*---------------------------------------------------------------------------*/
|
//-----------------------------------------------------------------------------
|
||||||
#ifdef WIN32
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <slvs.h>
|
#include "slvs.h"
|
||||||
|
|
||||||
static Slvs_System sys;
|
Slvs_System sys;
|
||||||
|
|
||||||
static void *CheckMalloc(size_t n)
|
void *CheckMalloc(size_t n)
|
||||||
{
|
{
|
||||||
void *r = malloc(n);
|
void *r = malloc(n);
|
||||||
if(!r) {
|
if(!r) {
|
||||||
|
@ -27,30 +21,30 @@ static void *CheckMalloc(size_t n)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
* An example of a constraint in 3d. We create a single group, with some
|
// An example of a constraint in 3d. We create a single group, with some
|
||||||
* entities and constraints.
|
// entities and constraints.
|
||||||
*---------------------------------------------------------------------------*/
|
//-----------------------------------------------------------------------------
|
||||||
void Example3d()
|
void Example3d(void)
|
||||||
{
|
{
|
||||||
/* This will contain a single group, which will arbitrarily number 1. */
|
// This will contain a single group, which will arbitrarily number 1.
|
||||||
Slvs_hGroup g = 1;
|
int g = 1;
|
||||||
|
|
||||||
/* A point, initially at (x y z) = (10 10 10) */
|
// A point, initially at (x y z) = (10 10 10)
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(1, g, 10.0);
|
sys.param[sys.params++] = Slvs_MakeParam(1, g, 10.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(2, g, 10.0);
|
sys.param[sys.params++] = Slvs_MakeParam(2, g, 10.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(3, g, 10.0);
|
sys.param[sys.params++] = Slvs_MakeParam(3, g, 10.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint3d(101, g, 1, 2, 3);
|
sys.entity[sys.entities++] = Slvs_MakePoint3d(101, g, 1, 2, 3);
|
||||||
/* and a second point at (20 20 20) */
|
// and a second point at (20 20 20)
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(4, g, 20.0);
|
sys.param[sys.params++] = Slvs_MakeParam(4, g, 20.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(5, g, 20.0);
|
sys.param[sys.params++] = Slvs_MakeParam(5, g, 20.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(6, g, 20.0);
|
sys.param[sys.params++] = Slvs_MakeParam(6, g, 20.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint3d(102, g, 4, 5, 6);
|
sys.entity[sys.entities++] = Slvs_MakePoint3d(102, g, 4, 5, 6);
|
||||||
/* and a line segment connecting them. */
|
// and a line segment connecting them.
|
||||||
sys.entity[sys.entities++] = Slvs_MakeLineSegment(200, g,
|
sys.entity[sys.entities++] = Slvs_MakeLineSegment(200, g,
|
||||||
SLVS_FREE_IN_3D, 101, 102);
|
SLVS_FREE_IN_3D, 101, 102);
|
||||||
|
|
||||||
/* The distance between the points should be 30.0 units. */
|
// The distance between the points should be 30.0 units.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
1, g,
|
1, g,
|
||||||
SLVS_C_PT_PT_DISTANCE,
|
SLVS_C_PT_PT_DISTANCE,
|
||||||
|
@ -58,13 +52,13 @@ void Example3d()
|
||||||
30.0,
|
30.0,
|
||||||
101, 102, 0, 0);
|
101, 102, 0, 0);
|
||||||
|
|
||||||
/* Let's tell the solver to keep the second point as close to constant
|
// Let's tell the solver to keep the second point as close to constant
|
||||||
* as possible, instead moving the first point. */
|
// as possible, instead moving the first point.
|
||||||
sys.dragged[0] = 4;
|
sys.dragged[0] = 4;
|
||||||
sys.dragged[1] = 5;
|
sys.dragged[1] = 5;
|
||||||
sys.dragged[2] = 6;
|
sys.dragged[2] = 6;
|
||||||
|
|
||||||
/* Now that we have written our system, we solve. */
|
// Now that we have written our system, we solve.
|
||||||
Slvs_Solve(&sys, g);
|
Slvs_Solve(&sys, g);
|
||||||
|
|
||||||
if(sys.result == SLVS_RESULT_OKAY) {
|
if(sys.result == SLVS_RESULT_OKAY) {
|
||||||
|
@ -78,25 +72,25 @@ void Example3d()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
* An example of a constraint in 2d. In our first group, we create a workplane
|
// An example of a constraint in 2d. In our first group, we create a workplane
|
||||||
* along the reference frame's xy plane. In a second group, we create some
|
// along the reference frame's xy plane. In a second group, we create some
|
||||||
* entities in that group and dimension them.
|
// entities in that group and dimension them.
|
||||||
*---------------------------------------------------------------------------*/
|
//-----------------------------------------------------------------------------
|
||||||
void Example2d()
|
void Example2d(void)
|
||||||
{
|
{
|
||||||
Slvs_hGroup g;
|
int g;
|
||||||
double qw, qx, qy, qz;
|
double qw, qx, qy, qz;
|
||||||
|
|
||||||
g = 1;
|
g = 1;
|
||||||
/* First, we create our workplane. Its origin corresponds to the origin
|
// First, we create our workplane. Its origin corresponds to the origin
|
||||||
* of our base frame (x y z) = (0 0 0) */
|
// of our base frame (x y z) = (0 0 0)
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(1, g, 0.0);
|
sys.param[sys.params++] = Slvs_MakeParam(1, g, 0.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(2, g, 0.0);
|
sys.param[sys.params++] = Slvs_MakeParam(2, g, 0.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(3, g, 0.0);
|
sys.param[sys.params++] = Slvs_MakeParam(3, g, 0.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint3d(101, g, 1, 2, 3);
|
sys.entity[sys.entities++] = Slvs_MakePoint3d(101, g, 1, 2, 3);
|
||||||
/* and it is parallel to the xy plane, so it has basis vectors (1 0 0)
|
// and it is parallel to the xy plane, so it has basis vectors (1 0 0)
|
||||||
* and (0 1 0). */
|
// and (0 1 0).
|
||||||
Slvs_MakeQuaternion(1, 0, 0,
|
Slvs_MakeQuaternion(1, 0, 0,
|
||||||
0, 1, 0, &qw, &qx, &qy, &qz);
|
0, 1, 0, &qw, &qx, &qy, &qz);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(4, g, qw);
|
sys.param[sys.params++] = Slvs_MakeParam(4, g, qw);
|
||||||
|
@ -107,12 +101,12 @@ void Example2d()
|
||||||
|
|
||||||
sys.entity[sys.entities++] = Slvs_MakeWorkplane(200, g, 101, 102);
|
sys.entity[sys.entities++] = Slvs_MakeWorkplane(200, g, 101, 102);
|
||||||
|
|
||||||
/* Now create a second group. We'll solve group 2, while leaving group 1
|
// Now create a second group. We'll solve group 2, while leaving group 1
|
||||||
* constant; so the workplane that we've created will be locked down,
|
// constant; so the workplane that we've created will be locked down,
|
||||||
* and the solver can't move it. */
|
// and the solver can't move it.
|
||||||
g = 2;
|
g = 2;
|
||||||
/* These points are represented by their coordinates (u v) within the
|
// These points are represented by their coordinates (u v) within the
|
||||||
* workplane, so they need only two parameters each. */
|
// workplane, so they need only two parameters each.
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(11, g, 10.0);
|
sys.param[sys.params++] = Slvs_MakeParam(11, g, 10.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(12, g, 20.0);
|
sys.param[sys.params++] = Slvs_MakeParam(12, g, 20.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint2d(301, g, 200, 11, 12);
|
sys.entity[sys.entities++] = Slvs_MakePoint2d(301, g, 200, 11, 12);
|
||||||
|
@ -121,11 +115,11 @@ void Example2d()
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(14, g, 10.0);
|
sys.param[sys.params++] = Slvs_MakeParam(14, g, 10.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint2d(302, g, 200, 13, 14);
|
sys.entity[sys.entities++] = Slvs_MakePoint2d(302, g, 200, 13, 14);
|
||||||
|
|
||||||
/* And we create a line segment with those endpoints. */
|
// And we create a line segment with those endpoints.
|
||||||
sys.entity[sys.entities++] = Slvs_MakeLineSegment(400, g,
|
sys.entity[sys.entities++] = Slvs_MakeLineSegment(400, g,
|
||||||
200, 301, 302);
|
200, 301, 302);
|
||||||
|
|
||||||
/* Now three more points. */
|
// Now three more points.
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(15, g, 100.0);
|
sys.param[sys.params++] = Slvs_MakeParam(15, g, 100.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(16, g, 120.0);
|
sys.param[sys.params++] = Slvs_MakeParam(16, g, 120.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint2d(303, g, 200, 15, 16);
|
sys.entity[sys.entities++] = Slvs_MakePoint2d(303, g, 200, 15, 16);
|
||||||
|
@ -138,12 +132,12 @@ void Example2d()
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(20, g, 115.0);
|
sys.param[sys.params++] = Slvs_MakeParam(20, g, 115.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint2d(305, g, 200, 19, 20);
|
sys.entity[sys.entities++] = Slvs_MakePoint2d(305, g, 200, 19, 20);
|
||||||
|
|
||||||
/* And arc, centered at point 303, starting at point 304, ending at
|
// And arc, centered at point 303, starting at point 304, ending at
|
||||||
* point 305. */
|
// point 305.
|
||||||
sys.entity[sys.entities++] = Slvs_MakeArcOfCircle(401, g, 200, 102,
|
sys.entity[sys.entities++] = Slvs_MakeArcOfCircle(401, g, 200, 102,
|
||||||
303, 304, 305);
|
303, 304, 305);
|
||||||
|
|
||||||
/* Now one more point, and a distance */
|
// Now one more point, and a distance
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(21, g, 200.0);
|
sys.param[sys.params++] = Slvs_MakeParam(21, g, 200.0);
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(22, g, 200.0);
|
sys.param[sys.params++] = Slvs_MakeParam(22, g, 200.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakePoint2d(306, g, 200, 21, 22);
|
sys.entity[sys.entities++] = Slvs_MakePoint2d(306, g, 200, 21, 22);
|
||||||
|
@ -151,13 +145,13 @@ void Example2d()
|
||||||
sys.param[sys.params++] = Slvs_MakeParam(23, g, 30.0);
|
sys.param[sys.params++] = Slvs_MakeParam(23, g, 30.0);
|
||||||
sys.entity[sys.entities++] = Slvs_MakeDistance(307, g, 200, 23);
|
sys.entity[sys.entities++] = Slvs_MakeDistance(307, g, 200, 23);
|
||||||
|
|
||||||
/* And a complete circle, centered at point 306 with radius equal to
|
// And a complete circle, centered at point 306 with radius equal to
|
||||||
* distance 307. The normal is 102, the same as our workplane. */
|
// distance 307. The normal is 102, the same as our workplane.
|
||||||
sys.entity[sys.entities++] = Slvs_MakeCircle(402, g, 200,
|
sys.entity[sys.entities++] = Slvs_MakeCircle(402, g, 200,
|
||||||
306, 102, 307);
|
306, 102, 307);
|
||||||
|
|
||||||
|
|
||||||
/* The length of our line segment is 30.0 units. */
|
// The length of our line segment is 30.0 units.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
1, g,
|
1, g,
|
||||||
SLVS_C_PT_PT_DISTANCE,
|
SLVS_C_PT_PT_DISTANCE,
|
||||||
|
@ -165,46 +159,45 @@ void Example2d()
|
||||||
30.0,
|
30.0,
|
||||||
301, 302, 0, 0);
|
301, 302, 0, 0);
|
||||||
|
|
||||||
/* And the distance from our line segment to the origin is 10.0 units. */
|
// And the distance from our line segment to the origin is 10.0 units.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
2, g,
|
2, g,
|
||||||
SLVS_C_PT_LINE_DISTANCE,
|
SLVS_C_PT_LINE_DISTANCE,
|
||||||
200,
|
200,
|
||||||
10.0,
|
10.0,
|
||||||
101, 0, 400, 0);
|
101, 0, 400, 0);
|
||||||
/* And the line segment is vertical. */
|
// And the line segment is vertical.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
3, g,
|
3, g,
|
||||||
SLVS_C_VERTICAL,
|
SLVS_C_VERTICAL,
|
||||||
200,
|
200,
|
||||||
0.0,
|
0.0,
|
||||||
0, 0, 400, 0);
|
0, 0, 400, 0);
|
||||||
/* And the distance from one endpoint to the origin is 15.0 units. */
|
// And the distance from one endpoint to the origin is 15.0 units.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
4, g,
|
4, g,
|
||||||
SLVS_C_PT_PT_DISTANCE,
|
SLVS_C_PT_PT_DISTANCE,
|
||||||
200,
|
200,
|
||||||
15.0,
|
15.0,
|
||||||
301, 101, 0, 0);
|
301, 101, 0, 0);
|
||||||
#if 0
|
/*
|
||||||
/* And same for the other endpoint; so if you add this constraint then
|
// And same for the other endpoint; so if you add this constraint then
|
||||||
* the sketch is overconstrained and will signal an error. */
|
// the sketch is overconstrained and will signal an error.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
5, g,
|
5, g,
|
||||||
SLVS_C_PT_PT_DISTANCE,
|
SLVS_C_PT_PT_DISTANCE,
|
||||||
200,
|
200,
|
||||||
18.0,
|
18.0,
|
||||||
302, 101, 0, 0);
|
302, 101, 0, 0); */
|
||||||
#endif /* 0 */
|
|
||||||
|
|
||||||
/* The arc and the circle have equal radius. */
|
// The arc and the circle have equal radius.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
6, g,
|
6, g,
|
||||||
SLVS_C_EQUAL_RADIUS,
|
SLVS_C_EQUAL_RADIUS,
|
||||||
200,
|
200,
|
||||||
0.0,
|
0.0,
|
||||||
0, 0, 401, 402);
|
0, 0, 401, 402);
|
||||||
/* The arc has radius 17.0 units. */
|
// The arc has radius 17.0 units.
|
||||||
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
sys.constraint[sys.constraints++] = Slvs_MakeConstraint(
|
||||||
7, g,
|
7, g,
|
||||||
SLVS_C_DIAMETER,
|
SLVS_C_DIAMETER,
|
||||||
|
@ -212,11 +205,11 @@ void Example2d()
|
||||||
17.0*2,
|
17.0*2,
|
||||||
0, 0, 401, 0);
|
0, 0, 401, 0);
|
||||||
|
|
||||||
/* If the solver fails, then ask it to report which constraints caused
|
// If the solver fails, then ask it to report which constraints caused
|
||||||
* the problem. */
|
// the problem.
|
||||||
sys.calculateFaileds = 1;
|
sys.calculateFaileds = 1;
|
||||||
|
|
||||||
/* And solve. */
|
// And solve.
|
||||||
Slvs_Solve(&sys, g);
|
Slvs_Solve(&sys, g);
|
||||||
|
|
||||||
if(sys.result == SLVS_RESULT_OKAY) {
|
if(sys.result == SLVS_RESULT_OKAY) {
|
||||||
|
@ -249,8 +242,9 @@ void Example2d()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
|
memset(&sys, 0, sizeof(sys));
|
||||||
sys.param = CheckMalloc(50*sizeof(sys.param[0]));
|
sys.param = CheckMalloc(50*sizeof(sys.param[0]));
|
||||||
sys.entity = CheckMalloc(50*sizeof(sys.entity[0]));
|
sys.entity = CheckMalloc(50*sizeof(sys.entity[0]));
|
||||||
sys.constraint = CheckMalloc(50*sizeof(sys.constraint[0]));
|
sys.constraint = CheckMalloc(50*sizeof(sys.constraint[0]));
|
||||||
|
@ -258,7 +252,7 @@ int main()
|
||||||
sys.failed = CheckMalloc(50*sizeof(sys.failed[0]));
|
sys.failed = CheckMalloc(50*sizeof(sys.failed[0]));
|
||||||
sys.faileds = 50;
|
sys.faileds = 50;
|
||||||
|
|
||||||
/*Example3d();*/
|
// Example3d();
|
||||||
for(;;) {
|
for(;;) {
|
||||||
Example2d();
|
Example2d();
|
||||||
sys.params = sys.constraints = sys.entities = 0;
|
sys.params = sys.constraints = sys.entities = 0;
|
||||||
|
|
|
@ -313,10 +313,6 @@ SLVS_C_LENGTH_RATIO*
|
||||||
The length of line entityA divided by the length of line entityB is
|
The length of line entityA divided by the length of line entityB is
|
||||||
equal to valA.
|
equal to valA.
|
||||||
|
|
||||||
SLVS_C_LENGTH_DIFFERENCE*
|
|
||||||
|
|
||||||
The lengths of line entityA and line entityB differ by valA.
|
|
||||||
|
|
||||||
SLVS_C_EQ_LEN_PT_LINE_D*
|
SLVS_C_EQ_LEN_PT_LINE_D*
|
||||||
|
|
||||||
The length of the line entityA is equal to the distance from point
|
The length of the line entityA is equal to the distance from point
|
||||||
|
|
|
@ -511,7 +511,6 @@ Module VbDemo
|
||||||
Public Const SLVS_C_PROJ_PT_DISTANCE As Integer = 100030
|
Public Const SLVS_C_PROJ_PT_DISTANCE As Integer = 100030
|
||||||
Public Const SLVS_C_WHERE_DRAGGED As Integer = 100031
|
Public Const SLVS_C_WHERE_DRAGGED As Integer = 100031
|
||||||
Public Const SLVS_C_CURVE_CURVE_TANGENT As Integer = 100032
|
Public Const SLVS_C_CURVE_CURVE_TANGENT As Integer = 100032
|
||||||
Public Const SLVS_C_LENGTH_DIFFERENCE As Integer = 100033
|
|
||||||
|
|
||||||
<StructLayout(LayoutKind.Sequential)> Public Structure Slvs_Constraint
|
<StructLayout(LayoutKind.Sequential)> Public Structure Slvs_Constraint
|
||||||
Public h As UInteger
|
Public h As UInteger
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 6fbcce0938caaccdbea44d826759aa2e587fe2f7
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit d4724ee921c4fa399ccbd0019c3d6917452e0ffd
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 069083cccd73d1d68da68116c8d050bb62cdfe0e
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 6f362317bf3f176b613be48512a88b78125c79f4
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit e9c3d83d5a04835806287f1e8c0f2d3a962d6673
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 5561dfc3f7e992454076ff3f10a0554c6b407e19
|
|
373
extlib/si/si.h
|
@ -1,373 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* si.h -- SpaceWare input library header
|
|
||||||
*
|
|
||||||
* $Id: si.h,v 1.22 1998/03/12 11:07:03 mfarr Exp $
|
|
||||||
*
|
|
||||||
* SpaceWare input library
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (C) 1998-2001 3Dconnexion. All rights reserved.
|
|
||||||
* Permission to use, copy, modify, and distribute this software for all
|
|
||||||
* purposes and without fees is hereby grated provided that this copyright
|
|
||||||
* notice appears in all copies. Permission to modify this software is granted
|
|
||||||
* and 3Dconnexion will support such modifications only is said modifications are
|
|
||||||
* approved by 3Dconnexion.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SI_H_
|
|
||||||
#define _SI_H_
|
|
||||||
|
|
||||||
static char incFileNameCvsId[]="(C) 1996 Spacetec IMC Corporation: $Id: si.h,v 1.22 1998/03/12 11:07:03 mfarr Exp $";
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include "spwmacro.h"
|
|
||||||
#include "spwdata.h"
|
|
||||||
#include "siSync.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "spwerror.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* UI modes
|
|
||||||
*/
|
|
||||||
#define SI_UI_ALL_CONTROLS 0xffffffffL
|
|
||||||
#define SI_UI_NO_CONTROLS 0x00000000L
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These UI modes are left here for legacy applications.
|
|
||||||
*/
|
|
||||||
#define SI_UI_FILTERS 0x00000001L
|
|
||||||
#define SI_UI_FUNC_BUTTONS 0x00000002L
|
|
||||||
#define SI_UI_RESET_BUTTONS 0x00000004L
|
|
||||||
#define SI_UI_SENSITIVITY 0x00000008L
|
|
||||||
#define SI_UI_TUNING 0x00000010L
|
|
||||||
#define SI_UI_DIALOG_POPUP 0x00000020L
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Device types and classes
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_ALL_TYPES = -1,
|
|
||||||
SI_UNKNOWN_DEVICE = 0,
|
|
||||||
SI_SPACEBALL_2003 = 1,
|
|
||||||
SI_SPACEBALL_3003 = 2,
|
|
||||||
SI_SPACE_CONTROLLER = 3,
|
|
||||||
SI_AVENGER = 4,
|
|
||||||
SI_SPACEORB_360 = 5,
|
|
||||||
SI_NAVIGATOR = 6,
|
|
||||||
SI_SPACEBALL_2003A = 7,
|
|
||||||
SI_SPACEBALL_2003B = 8,
|
|
||||||
SI_SPACEBALL_2003C = 9,
|
|
||||||
SI_SPACEBALL_3003A = 10,
|
|
||||||
SI_SPACEBALL_3003B = 11,
|
|
||||||
SI_SPACEBALL_3003C = 12,
|
|
||||||
SI_SPACEBALL_4000 = 13,
|
|
||||||
SI_SPACEMOUSE_CLASSIC = 14,
|
|
||||||
SI_SPACEMOUSE_PLUS = 15,
|
|
||||||
SI_SPACEMOUSE_XT = 16,
|
|
||||||
SI_CYBERMAN = 17,
|
|
||||||
SI_CADMAN = 18,
|
|
||||||
SI_SPACEMOUSE_CLASSIC_PROMO = 19,
|
|
||||||
SI_SERIAL_CADMAN = 20,
|
|
||||||
SI_SPACEBALL_5000 = 21,
|
|
||||||
SI_TEST_NO_DEVICE = 22,
|
|
||||||
SI_3DX_KEYBOARD_BLACK = 23,
|
|
||||||
SI_3DX_KEYBOARD_WHITE = 24,
|
|
||||||
SI_TRAVELER = 25,
|
|
||||||
SI_TRAVELER1 = 26,
|
|
||||||
SI_SPACEBALL_5000A = 27,
|
|
||||||
SI_SPACEDRAGON = 28,
|
|
||||||
SI_SPACEPILOT = 29,
|
|
||||||
SI_NUM_DEV_TYPES /* Leave this last, add before it */
|
|
||||||
} SiDevType;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These defintions of device classes are left in for legacy applications.
|
|
||||||
*/
|
|
||||||
#define SI_HIGH_END 63
|
|
||||||
#define SI_MED_END 62
|
|
||||||
#define SI_LOW_END 61
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Data retrieval mode, only SI_EVENT is currently supported.
|
|
||||||
*/
|
|
||||||
#define SI_EVENT 0x0001
|
|
||||||
#define SI_POLL 0x0002
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get event flags
|
|
||||||
*/
|
|
||||||
#define SI_AVERAGE_EVENTS 0x0001
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is an INTERNAL flag used by the polling mechanism, user applications
|
|
||||||
* should NOT send this flag.
|
|
||||||
*/
|
|
||||||
#define SI_POLLED_REQUEST 0x0100
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SpaceWare event types
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_BUTTON_EVENT = 1,
|
|
||||||
SI_MOTION_EVENT,
|
|
||||||
SI_COMBO_EVENT, /* Not implemented */
|
|
||||||
SI_ZERO_EVENT,
|
|
||||||
SI_EXCEPTION_EVENT,
|
|
||||||
SI_OUT_OF_BAND,
|
|
||||||
SI_ORIENTATION_EVENT,
|
|
||||||
SI_KEYBOARD_EVENT,
|
|
||||||
SI_LPFK_EVENT,
|
|
||||||
SI_APP_EVENT, /* Application functions */
|
|
||||||
SI_SYNC_EVENT, /* GUI synchronization events */
|
|
||||||
SI_BUTTON_PRESS_EVENT, /* Single button events (replace SI_BUTTON_EVENT) */
|
|
||||||
SI_BUTTON_RELEASE_EVENT /* Single button events (replace SI_BUTTON_EVENT) */
|
|
||||||
} SiEventType;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Data modes
|
|
||||||
*/
|
|
||||||
#define SI_MODE_NORMALIZE 0x0001
|
|
||||||
#define SI_MODE_COMPRESS 0x0002
|
|
||||||
#define SI_MODE_SENSITIVITY 0x0004
|
|
||||||
#define SI_MODE_TUNING 0x0008
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Motion data offsets
|
|
||||||
*/
|
|
||||||
#define SI_TX 0 /* Translation X value */
|
|
||||||
#define SI_TY 1 /* Translation Y value */
|
|
||||||
#define SI_TZ 2 /* Translation Z value */
|
|
||||||
#define SI_RX 3 /* Rotation X value */
|
|
||||||
#define SI_RY 4 /* Rotation Y value */
|
|
||||||
#define SI_RZ 5 /* Rotation Z value */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Reserved buttons
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SI_RESET_DEVICE_BIT 0x00000001L
|
|
||||||
#define SI_APP_FIT_BIT 0x80000000L
|
|
||||||
#define SI_APP_DIALOG_BIT 0x40000000L
|
|
||||||
|
|
||||||
#define SI_RESET_DEVICE_BUTTON 0
|
|
||||||
#define SI_APP_FIT_BUTTON 31
|
|
||||||
#define SI_APP_DIALOG_BUTTON 30
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Miscellaneous
|
|
||||||
*/
|
|
||||||
#define SI_END_ARGS 0
|
|
||||||
#define SI_NO_HANDLE ((SiHdl) NULL)
|
|
||||||
#define SI_ALL_HANDLES ((SiHdl) NULL)
|
|
||||||
#define SI_ANY_HANDLE ((SiHdl) NULL)
|
|
||||||
#define SI_NO_TRANSCTL ((SiTransCtl) NULL)
|
|
||||||
#define SI_NO_MASK ((SiTypeMask *) NULL)
|
|
||||||
#define SI_ANY_DEVICE -1
|
|
||||||
#define SI_NO_DEVICE -1
|
|
||||||
#define SI_NO_TYPE -1
|
|
||||||
#define SI_NO_LIST -1
|
|
||||||
#define SI_NO_BUTTON -1
|
|
||||||
#define SI_STRSIZE 128
|
|
||||||
#define SI_MAXBUF 128
|
|
||||||
#define SI_KEY_MAXBUF 5120
|
|
||||||
|
|
||||||
typedef int SiDevID; /* Device ID */
|
|
||||||
typedef void *SiHdl; /* SpaceWare handle */
|
|
||||||
typedef void *SiTransCtl; /* SpaceWare transport control handle */
|
|
||||||
|
|
||||||
typedef struct /* Open data */
|
|
||||||
{
|
|
||||||
|
|
||||||
HWND hWnd; /* Window handle for SpaceWare messages. */
|
|
||||||
SiTransCtl transCtl; /* SpaceWare transport control handle. Reserved */
|
|
||||||
/* for the s80 transport mechanism. */
|
|
||||||
DWORD processID; /* The process ID for this application. */
|
|
||||||
char exeFile[MAX_PATH]; /* The executable name of the process. */
|
|
||||||
SPWint32 libFlag; /* Library version flag. */
|
|
||||||
} SiOpenData;
|
|
||||||
|
|
||||||
typedef struct /* Get event Data */
|
|
||||||
{
|
|
||||||
|
|
||||||
UINT msg;
|
|
||||||
WPARAM wParam;
|
|
||||||
LPARAM lParam;
|
|
||||||
} SiGetEventData;
|
|
||||||
|
|
||||||
typedef struct /* Device type mask */
|
|
||||||
{
|
|
||||||
unsigned char mask[8];
|
|
||||||
} SiTypeMask;
|
|
||||||
|
|
||||||
typedef struct /* Device port information */
|
|
||||||
{
|
|
||||||
SiDevID devID; /* Device ID */
|
|
||||||
int devType; /* Device type */
|
|
||||||
int devClass; /* Device class */
|
|
||||||
char devName[SI_STRSIZE]; /* Device name */
|
|
||||||
char portName[SI_STRSIZE]; /* Port name */
|
|
||||||
} SiDevPort;
|
|
||||||
|
|
||||||
typedef struct /* Device information */
|
|
||||||
{
|
|
||||||
char firmware[SI_STRSIZE]; /* Firmware version */
|
|
||||||
int devType; /* Device type */
|
|
||||||
int numButtons; /* Number of buttons */
|
|
||||||
int numDegrees; /* Number of degrees of freedom */
|
|
||||||
SPWbool canBeep; /* Device beeps */
|
|
||||||
int majorVersion; /* Major version number */
|
|
||||||
int minorVersion; /* Minor version number */
|
|
||||||
} SiDevInfo;
|
|
||||||
|
|
||||||
typedef struct /* Button information */
|
|
||||||
{
|
|
||||||
char name[SI_STRSIZE]; /* Contains the name of a button for display in an app's GUI */
|
|
||||||
} SiButtonName;
|
|
||||||
|
|
||||||
typedef struct /* Button information */
|
|
||||||
{
|
|
||||||
char name[SI_STRSIZE]; /* Contains the name of a device for display in an app's GUI */
|
|
||||||
} SiDeviceName;
|
|
||||||
|
|
||||||
typedef struct /* Version information */
|
|
||||||
{
|
|
||||||
int major; /* Major version number */
|
|
||||||
int minor; /* Minor version number */
|
|
||||||
int build; /* Build number */
|
|
||||||
char version[SI_STRSIZE]; /* Version string */
|
|
||||||
char date[SI_STRSIZE]; /* Date string */
|
|
||||||
} SiVerInfo;
|
|
||||||
|
|
||||||
typedef struct /* Sensitivity parameters */
|
|
||||||
{
|
|
||||||
char dummy;
|
|
||||||
} SiSensitivity;
|
|
||||||
|
|
||||||
typedef struct /* Tuning parameters */
|
|
||||||
{
|
|
||||||
char dummy;
|
|
||||||
} SiTuning;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
SPWuint8 code; /* Out of band message code */
|
|
||||||
union {
|
|
||||||
SPWuint8 message[SI_MAXBUF-1]; /* The actual message */
|
|
||||||
void *pvoid[SI_MAXBUF/8]; /* void ptrs. Enough room for 64bit ptrs */
|
|
||||||
};
|
|
||||||
} SiSpwOOB;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
SPWuint8 string[SI_KEY_MAXBUF]; /* String for keyboard data */
|
|
||||||
} SiKeyboardData;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
SPWuint32 lpfk; /* LPFK number to send */
|
|
||||||
} SiLpfkData;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_LEFT = 0,
|
|
||||||
SI_RIGHT
|
|
||||||
} SiOrientation;
|
|
||||||
|
|
||||||
typedef struct /* Bitmasks of button states */
|
|
||||||
{
|
|
||||||
SPWuint32 last; /* Buttons pressed as of last event */
|
|
||||||
SPWuint32 current; /* Buttons pressed as of this event */
|
|
||||||
SPWuint32 pressed; /* Buttons pressed this event */
|
|
||||||
SPWuint32 released; /* Buttons released this event */
|
|
||||||
} SiButtonData;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SI_BUTTON_PRESS_EVENT & SI_BUTTON_RELEASE_EVENT are hardware button
|
|
||||||
* events. Meaning that they are meant to be sent when a specific hardware
|
|
||||||
* button is pressed. The correlation between the actual hardware button
|
|
||||||
* and the resulting button number could be broken by careful editing of
|
|
||||||
* a config file, but it is intended that the correlation be intact.
|
|
||||||
* This is basically the same as SI_BUTTON_EVENT, but allows
|
|
||||||
* more than 29 buttons because it isn't limited to a 32-bit mask.
|
|
||||||
* Different entries in the config file determine whether SI_BUTTON_PRESS/RELEASE_EVENTs
|
|
||||||
* or SI_BUTTON_EVENTs will be generated.
|
|
||||||
* This event was introduced in 3DxWare 5.2.
|
|
||||||
*/
|
|
||||||
typedef struct /* Data for SI_BUTTON_PRESS/RELEASE_EVENT */
|
|
||||||
{
|
|
||||||
SPWuint32 buttonNumber; /* The button number that went down/up in a *
|
|
||||||
* SI_BUTTON_PRESS/RELEASE_EVENT event */
|
|
||||||
} SiHWButtonData;
|
|
||||||
|
|
||||||
typedef struct /* Data for SI_APP_EVENT */
|
|
||||||
{
|
|
||||||
SPWuint32 functionNumber; /* The Application-specific function number
|
|
||||||
* invoked by the user in a SI_APP_EVENT */
|
|
||||||
} SiAppEventData;
|
|
||||||
|
|
||||||
typedef struct /* SpaceWare data */
|
|
||||||
{
|
|
||||||
SiButtonData bData; /* Button data */
|
|
||||||
long mData[6]; /* Motion data (index via SI_TX, etc) */
|
|
||||||
long period; /* Period (milliseconds) */
|
|
||||||
} SiSpwData;
|
|
||||||
|
|
||||||
typedef struct /* SpaceWare event */
|
|
||||||
{
|
|
||||||
int type; /* Event type */
|
|
||||||
union
|
|
||||||
{
|
|
||||||
SiSpwData spwData; /* Button, motion, or combo data */
|
|
||||||
SiSpwOOB spwOOB; /* Out of band message */
|
|
||||||
SiOrientation spwOrientation;/* Which hand orientation is the device */
|
|
||||||
char exData[SI_MAXBUF]; /* Exception data */
|
|
||||||
SiKeyboardData spwKeyData; /* String for keyboard data */
|
|
||||||
SiLpfkData spwLpfkData; /* LPFK data */
|
|
||||||
SiSyncPacket siSyncPacket; /* GUI SyncPacket sent to applications */
|
|
||||||
SiHWButtonData hwButtonEvent;/* ButtonNumber that goes with *
|
|
||||||
* SI_BUTTON_PRESS/RELEASE_EVENT */
|
|
||||||
SiAppEventData appEventData; /* Application event function data that *
|
|
||||||
* goes with an SI_APP_EVENT event */
|
|
||||||
} u;
|
|
||||||
} SiSpwEvent;
|
|
||||||
|
|
||||||
typedef struct /* Event handler (for SiDispatch) */
|
|
||||||
{
|
|
||||||
int (*func) (SiOpenData *, SiGetEventData *, SiSpwEvent *, void *);
|
|
||||||
void *data;
|
|
||||||
} SiEventHandler;
|
|
||||||
|
|
||||||
typedef struct /* SpaceWare event handlers */
|
|
||||||
{
|
|
||||||
SiEventHandler button; /* Button event handler */
|
|
||||||
SiEventHandler motion; /* Motion event handler */
|
|
||||||
SiEventHandler combo; /* Combo event handler */
|
|
||||||
SiEventHandler zero; /* Zero event handler */
|
|
||||||
SiEventHandler exception; /* Exception event handler */
|
|
||||||
} SiSpwHandlers;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
enum SpwRetVal SiAndTypeMask (SiTypeMask *pTMaskA, SiTypeMask *pTMaskB);
|
|
||||||
int SiGetPortList (SiDevPort **ppPort);
|
|
||||||
void SiFreePortList (SiDevPort *pPort);
|
|
||||||
void SiTune2003 (SiSpwEvent *pEvent);
|
|
||||||
void SiTuneSC (SiSpwEvent *pEvent);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SI_H_ */
|
|
|
@ -1,206 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* siSync.h -- 3DxWare GUI Synchronization header
|
|
||||||
*
|
|
||||||
* Written: September 2004
|
|
||||||
* Author: Jim Wick
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (c) 1998-2005 3Dconnexion. All rights reserved.
|
|
||||||
* Permission to use, copy, modify, and distribute this software for all
|
|
||||||
* purposes and without fees is hereby grated provided that this copyright
|
|
||||||
* notice appears in all copies. Permission to modify this software is granted
|
|
||||||
* and 3Dconnexion will support such modifications only is said modifications are
|
|
||||||
* approved by 3Dconnexion.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SISYNC_H_
|
|
||||||
#define _SISYNC_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Constants
|
|
||||||
*/
|
|
||||||
#define SI_SYNC_PACKET_ID 27711
|
|
||||||
#define SI_SYNC_VERSION_MAJOR 1
|
|
||||||
#define SI_SYNC_VERSION_MINOR 0
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Absolute Internal Function Numbers
|
|
||||||
* These are function numbers that will never change.
|
|
||||||
* For use with Set BUTTON_ASSIGNMENT_ABSOLUTE packets, and some INVOKE items.
|
|
||||||
* Some functions (keys) can not be INVOKED because there is a separate
|
|
||||||
* press and release and that difference is not exposed.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_FUNCTION_MENU_TOGGLE = 12,
|
|
||||||
SI_SYNC_FUNCTION_TRANS_TOGGLE = 13,
|
|
||||||
SI_SYNC_FUNCTION_ROT_TOGGLE = 14,
|
|
||||||
SI_SYNC_FUNCTION_HPV_TOGGLE = 15,
|
|
||||||
SI_SYNC_FUNCTION_DEC_SENS = 16,
|
|
||||||
SI_SYNC_FUNCTION_INC_SENS = 17,
|
|
||||||
SI_SYNC_FUNCTION_RESTORE_DEF = 18,
|
|
||||||
SI_SYNC_FUNCTION_PAN = 19,
|
|
||||||
SI_SYNC_FUNCTION_ZOOM = 20,
|
|
||||||
SI_SYNC_FUNCTION_TX = 21,
|
|
||||||
SI_SYNC_FUNCTION_TY = 22,
|
|
||||||
SI_SYNC_FUNCTION_TZ = 23,
|
|
||||||
SI_SYNC_FUNCTION_RX = 24,
|
|
||||||
SI_SYNC_FUNCTION_RY = 25,
|
|
||||||
SI_SYNC_FUNCTION_RZ = 26,
|
|
||||||
SI_SYNC_FUNCTION_REZERO_DEVICE = 27,
|
|
||||||
SI_SYNC_FUNCTION_SAVE = 33,
|
|
||||||
SI_SYNC_FUNCTION_RELOAD = 57,
|
|
||||||
SI_SYNC_FUNCTION_SHIFT_KEY = 60,
|
|
||||||
SI_SYNC_FUNCTION_CTRL_KEY = 61,
|
|
||||||
SI_SYNC_FUNCTION_ALT_KEY = 62,
|
|
||||||
SI_SYNC_FUNCTION_RESTORE_SENS = 63,
|
|
||||||
SI_SYNC_FUNCTION_SPACE_KEY = 64,
|
|
||||||
SI_SYNC_FUNCTION_CTRL_SHIFT_KEY = 65,
|
|
||||||
SI_SYNC_FUNCTION_CTRL_ALT_KEY = 66,
|
|
||||||
SI_SYNC_FUNCTION_SHIFT_ALT_KEY = 67,
|
|
||||||
SI_SYNC_FUNCTION_TAB_KEY = 68,
|
|
||||||
SI_SYNC_FUNCTION_RETURN_KEY = 69,
|
|
||||||
SI_SYNC_FUNCTION_DEC_TRANS_SENS = 70,
|
|
||||||
SI_SYNC_FUNCTION_INC_TRANS_SENS = 71,
|
|
||||||
SI_SYNC_FUNCTION_DEC_ROT_SENS = 72,
|
|
||||||
SI_SYNC_FUNCTION_INC_ROT_SENS = 73,
|
|
||||||
SI_SYNC_FUNCTION_DEC_PAN_SENS = 74,
|
|
||||||
SI_SYNC_FUNCTION_INC_PAN_SENS = 75,
|
|
||||||
SI_SYNC_FUNCTION_DEC_ZOOM_SENS = 76,
|
|
||||||
SI_SYNC_FUNCTION_INC_ZOOM_SENS = 77,
|
|
||||||
SI_SYNC_FUNCTION_ESC_KEY = 78,
|
|
||||||
SI_SYNC_FUNCTION_3DX_HELP = 94,
|
|
||||||
SI_SYNC_FUNCTION_APP_HELP = 95,
|
|
||||||
SI_SYNC_FUNCTION_DIALOG_TOGGLE_FN= 96,
|
|
||||||
SI_SYNC_FUNCTION_FIT_FN = 97
|
|
||||||
} SiSyncAbsFunctionNumber;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sync Op Codes
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_OP_COMMAND = 1,
|
|
||||||
SI_SYNC_OP_GET = 2,
|
|
||||||
SI_SYNC_OP_SET = 3
|
|
||||||
} SiSyncOpCode;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sync Item Codes
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_ITEM_VERSION = 1,
|
|
||||||
SI_SYNC_ITEM_QUERY = 2,
|
|
||||||
SI_SYNC_ITEM_SAVE_CONFIG = 3,
|
|
||||||
SI_SYNC_ITEM_NUMBER_OF_FUNCTIONS = 4,
|
|
||||||
SI_SYNC_ITEM_FUNCTION = 5,
|
|
||||||
SI_SYNC_ITEM_BUTTON_ASSIGNMENT = 6,
|
|
||||||
SI_SYNC_ITEM_BUTTON_ASSIGNMENT_ABSOLUTE = 7,
|
|
||||||
SI_SYNC_ITEM_BUTTON_NAME = 8,
|
|
||||||
SI_SYNC_ITEM_AXIS_LABEL = 9,
|
|
||||||
SI_SYNC_ITEM_ORIENTATION = 10,
|
|
||||||
SI_SYNC_ITEM_FILTER = 11,
|
|
||||||
SI_SYNC_ITEM_AXES_STATE = 12,
|
|
||||||
SI_SYNC_ITEM_INFO_LINE = 13,
|
|
||||||
SI_SYNC_ITEM_SCALE_OVERALL = 14,
|
|
||||||
SI_SYNC_ITEM_SCALE_TX = 15,
|
|
||||||
SI_SYNC_ITEM_SCALE_TY = 16,
|
|
||||||
SI_SYNC_ITEM_SCALE_TZ = 17,
|
|
||||||
SI_SYNC_ITEM_SCALE_RX = 18,
|
|
||||||
SI_SYNC_ITEM_SCALE_RY = 19,
|
|
||||||
SI_SYNC_ITEM_SCALE_RZ = 20,
|
|
||||||
SI_SYNC_ITEM_INVOKE_ABSOLUTE_FUNCTION = 21,
|
|
||||||
SI_SYNC_ITEM_BUTTON_STATE = 22
|
|
||||||
} SiSyncItemCode;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Filters
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_FILTER_TRANSLATIONS = 1,
|
|
||||||
SI_SYNC_FILTER_ROTATIONS = 2,
|
|
||||||
SI_SYNC_FILTER_DOMINANT = 3
|
|
||||||
} SiSyncFilter;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_FILTER_OFF = 0,
|
|
||||||
SI_SYNC_FILTER_ON = 1,
|
|
||||||
SI_SYNC_FILTER_IN_BETWEEN = 2
|
|
||||||
} SiSyncFilterValue;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Axes State
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_AXES_STATE_TX = (1<<0),
|
|
||||||
SI_SYNC_AXES_STATE_TY = (1<<1),
|
|
||||||
SI_SYNC_AXES_STATE_TZ = (1<<2),
|
|
||||||
SI_SYNC_AXES_STATE_RX = (1<<3),
|
|
||||||
SI_SYNC_AXES_STATE_RY = (1<<4),
|
|
||||||
SI_SYNC_AXES_STATE_RZ = (1<<5)
|
|
||||||
} SiSyncAxesStateBits;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int state; /* VURZYX (Tx = LSB (& 1<<0) */
|
|
||||||
} SiSyncAxesState;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Button State
|
|
||||||
* For indicating the state of whatever the button sets (in the LCD at this point).
|
|
||||||
* E.g., to show that Translations are currently OFF for the Translations Toggle button.
|
|
||||||
* OFF: reverse video, flag is not set
|
|
||||||
* ON: normal video, flag is set
|
|
||||||
* DISABLED: (greyed), status of flag is invalid at this time
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SI_SYNC_BUTTON_STATE_OFF = 0,
|
|
||||||
SI_SYNC_BUTTON_STATE_ON = 1,
|
|
||||||
SI_SYNC_BUTTON_STATE_DISABLED = 2,
|
|
||||||
} SiSyncButtonState;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Private / implementation structures
|
|
||||||
*
|
|
||||||
* We suggest you leave these hidden and use the accessor functions rather than
|
|
||||||
* directly accessing the structures.
|
|
||||||
*/
|
|
||||||
#include "siSyncPriv.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Accessor Function headers
|
|
||||||
*/
|
|
||||||
SPWuint32 SiSyncGetSize(SiSyncPacket p);
|
|
||||||
void SiSyncSetSize(SiSyncPacket *p, SPWuint32 size);
|
|
||||||
|
|
||||||
SPWuint32 SiSyncGetHashCode(SiSyncPacket p);
|
|
||||||
void SiSyncSetHashCode(SiSyncPacket *p, SPWuint32 hashCode);
|
|
||||||
|
|
||||||
SiSyncOpCode SiSyncGetOpCode(SiSyncPacket p);
|
|
||||||
void SiSyncSetOpCode(SiSyncPacket *p, SPWuint32 opCode);
|
|
||||||
|
|
||||||
SiSyncItemCode SiSyncGetItemCode(SiSyncPacket p);
|
|
||||||
void SiSyncSetItemCode(SiSyncPacket *p, SPWuint32 itemCode);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SI_SYNC_H_ */
|
|
|
@ -1,127 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* siSyncPriv.h -- 3DxWare GUI Synchronization Private header
|
|
||||||
*
|
|
||||||
* Written: June 2005
|
|
||||||
* Author: Jim Wick
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (c) 1998-2005 3Dconnexion. All rights reserved.
|
|
||||||
* Permission to use, copy, modify, and distribute this software for all
|
|
||||||
* purposes and without fees is hereby grated provided that this copyright
|
|
||||||
* notice appears in all copies. Permission to modify this software is granted
|
|
||||||
* and 3Dconnexion will support such modifications only is said modifications are
|
|
||||||
* approved by 3Dconnexion.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SISYNCPRIV_H_
|
|
||||||
#define _SISYNCPRIV_H_
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* All packets start with the same fields.
|
|
||||||
* Many packets have data following the itemCode.
|
|
||||||
*/
|
|
||||||
typedef struct /* Sync Packet */
|
|
||||||
{
|
|
||||||
SPWuint32 size; /* total packet size */
|
|
||||||
SPWuint32 hashCode; /* Hash code that syncs a question with an answer */
|
|
||||||
SiSyncOpCode opCode; /* OpCode */
|
|
||||||
SiSyncItemCode itemCode; /* itemCode */
|
|
||||||
/* There will, generally, be more data starting here.
|
|
||||||
* There will not be any pointers, the data will be in here.
|
|
||||||
*/
|
|
||||||
} SiSyncPacketHeader;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* I've enumerated all the possible packets here, not because they are all different,
|
|
||||||
* but mostly just for documentation. So the developer knows what parameters are
|
|
||||||
* expected with which packet type.
|
|
||||||
*/
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetVersionPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 major; SPWint32 minor; } SiSyncSetVersionPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncCommandQueryPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncCommandSaveConfigPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetNumberOfFunctionsPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 n; } SiSyncSetNumberOfFunctionsPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetFunctionPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; WCHAR name[1];} SiSyncSetFunctionPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetButtonAssignmentPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; } SiSyncSetButtonAssignmentPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWint32 n; } SiSyncSetButtonAssignmentAbsolutePacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; WCHAR name[1]; } SiSyncSetButtonNamePacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; } SiSyncGetAxisLabelPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; WCHAR name[1]; } SiSyncSetAxisLabelPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetOrientationPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 a[6]; } SiSyncSetOrientationPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SiSyncFilter i; } SiSyncGetFilterPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SiSyncFilter i; SiSyncFilterValue v; } SiSyncSetFilterPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetAxesStatePacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SiSyncAxesState a; } SiSyncSetAxesStatePacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 duration; WCHAR s[1]; } SiSyncSetInfoLinePacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleOverallPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleOverallPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTxPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTxPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTyPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTyPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleTzPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleTzPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRxPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRxPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRyPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRyPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; } SiSyncGetScaleRzPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWfloat32 v; } SiSyncSetScaleRzPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SiSyncAbsFunctionNumber i; } SiSyncAbsFunctionPacket;
|
|
||||||
typedef struct { SiSyncPacketHeader h; SPWint32 i; SPWbool state; } SiSyncSetButtonStatePacket;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
SiSyncPacketHeader h;
|
|
||||||
SiSyncGetVersionPacket gv;
|
|
||||||
SiSyncSetVersionPacket sv;
|
|
||||||
SiSyncCommandQueryPacket cq;
|
|
||||||
SiSyncCommandSaveConfigPacket cs;
|
|
||||||
SiSyncGetNumberOfFunctionsPacket gnf;
|
|
||||||
SiSyncSetNumberOfFunctionsPacket snf;
|
|
||||||
SiSyncGetFunctionPacket gf;
|
|
||||||
SiSyncSetFunctionPacket sf;
|
|
||||||
SiSyncGetButtonAssignmentPacket gba;
|
|
||||||
SiSyncSetButtonAssignmentPacket sba;
|
|
||||||
SiSyncSetButtonAssignmentAbsolutePacket sbaa;
|
|
||||||
SiSyncSetButtonNamePacket sbn;
|
|
||||||
SiSyncGetAxisLabelPacket ga;
|
|
||||||
SiSyncSetAxisLabelPacket sa;
|
|
||||||
SiSyncGetOrientationPacket go;
|
|
||||||
SiSyncSetOrientationPacket so;
|
|
||||||
SiSyncGetFilterPacket gfi;
|
|
||||||
SiSyncSetFilterPacket sfi;
|
|
||||||
SiSyncGetAxesStatePacket gas;
|
|
||||||
SiSyncSetAxesStatePacket sas;
|
|
||||||
SiSyncSetInfoLinePacket si;
|
|
||||||
SiSyncGetScaleOverallPacket gso;
|
|
||||||
SiSyncSetScaleOverallPacket sso;
|
|
||||||
SiSyncGetScaleTxPacket gtx;
|
|
||||||
SiSyncSetScaleTxPacket stx;
|
|
||||||
SiSyncGetScaleTyPacket gty;
|
|
||||||
SiSyncSetScaleTyPacket sty;
|
|
||||||
SiSyncGetScaleTzPacket gtz;
|
|
||||||
SiSyncSetScaleTzPacket stz;
|
|
||||||
SiSyncGetScaleRxPacket grx;
|
|
||||||
SiSyncSetScaleRxPacket srx;
|
|
||||||
SiSyncGetScaleRyPacket gry;
|
|
||||||
SiSyncSetScaleRyPacket sry;
|
|
||||||
SiSyncGetScaleRzPacket grz;
|
|
||||||
SiSyncSetScaleRzPacket srz;
|
|
||||||
SiSyncAbsFunctionPacket absf;
|
|
||||||
SiSyncSetButtonStatePacket sbs;
|
|
||||||
};
|
|
||||||
} SiSyncPacket;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _SI_SYNCPRIV_H_ */
|
|
|
@ -1,121 +0,0 @@
|
||||||
/*-----------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* siapp.h -- Si static library interface header file
|
|
||||||
*
|
|
||||||
* $Id: siapp.h,v 1.3 2001/01/16 01:18:49 HJin Exp $
|
|
||||||
*
|
|
||||||
* Contains function headers and type definitions for siapp.c.
|
|
||||||
*
|
|
||||||
*-----------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (c) 1998-2005 3Dconnexion. All rights reserved.
|
|
||||||
* Permission to use, copy, modify, and distribute this software for all
|
|
||||||
* purposes and without fees is hereby grated provided that this copyright
|
|
||||||
* notice appears in all copies. Permission to modify this software is granted
|
|
||||||
* and 3Dconnexion will support such modifications only if said modifications are
|
|
||||||
* approved by 3Dconnexion.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SIAPP_H
|
|
||||||
#define SIAPP_H
|
|
||||||
|
|
||||||
|
|
||||||
static char SiAppCvsId[]="(c) 1998-2005 3Dconnexion: $Id: siapp.h,v 1.3 2001/01/16 01:18:49 HJin Exp $";
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* some enumerated types used in siapp.c */
|
|
||||||
|
|
||||||
enum InitResult
|
|
||||||
{
|
|
||||||
NOT_LOADED,
|
|
||||||
FAILED,
|
|
||||||
LOADED
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ErrorCode
|
|
||||||
{
|
|
||||||
NO_DLL_ERROR=0,
|
|
||||||
DLL_LOAD_FAILURE,
|
|
||||||
DLL_FUNCTION_LOAD_FAILURE,
|
|
||||||
DLL_VAR_LOAD_FAILURE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* externally used functions */
|
|
||||||
|
|
||||||
enum SpwRetVal SiInitialize(void);
|
|
||||||
void SiTerminate(void);
|
|
||||||
int SiGetNumDevices (void);
|
|
||||||
SiDevID SiDeviceIndex (int idx);
|
|
||||||
int SiDispatch (SiHdl hdl, SiGetEventData *pData,
|
|
||||||
SiSpwEvent *pEvent, SiSpwHandlers *pDHandlers);
|
|
||||||
void SiOpenWinInit (SiOpenData *pData, HWND hWnd);
|
|
||||||
SiHdl SiOpen (char *pAppName, SiDevID devID, SiTypeMask *pTMask, int mode,
|
|
||||||
SiOpenData *pData);
|
|
||||||
enum SpwRetVal SiClose (SiHdl hdl);
|
|
||||||
void SiGetEventWinInit (SiGetEventData *pData,
|
|
||||||
UINT msg, WPARAM wParam, LPARAM lParam);
|
|
||||||
enum SpwRetVal SiGetEvent (SiHdl hdl, int flags, SiGetEventData *pData,
|
|
||||||
SiSpwEvent *pEvent);
|
|
||||||
enum SpwRetVal SiBeep (SiHdl hdl, char *string);
|
|
||||||
enum SpwRetVal SiRezero (SiHdl hdl);
|
|
||||||
enum SpwRetVal SiGrabDevice (SiHdl hdl, SPWbool exclusive);
|
|
||||||
enum SpwRetVal SiReleaseDevice (SiHdl hdl);
|
|
||||||
int SiButtonPressed (SiSpwEvent *pEvent);
|
|
||||||
int SiButtonReleased (SiSpwEvent *pEvent);
|
|
||||||
enum SpwRetVal SiSetUiMode (SiHdl hdl, SPWuint32 mode);
|
|
||||||
enum SpwRetVal SiSetTypeMask (SiTypeMask *pTMask, int type1, ...);
|
|
||||||
enum SpwRetVal SiGetDevicePort (SiDevID devID, SiDevPort *pPort);
|
|
||||||
enum SpwRetVal SiGetDriverInfo (SiVerInfo *pInfo);
|
|
||||||
void SiGetLibraryInfo (SiVerInfo *pInfo);
|
|
||||||
enum SpwRetVal SiGetDeviceInfo (SiHdl hdl, SiDevInfo *pInfo);
|
|
||||||
char * SpwErrorString (enum SpwRetVal val);
|
|
||||||
enum SpwRetVal SiSyncSendQuery(SiHdl hdl);
|
|
||||||
enum SpwRetVal SiSyncGetVersion(SiHdl hdl, SPWuint32 *pmajor, SPWuint32 *pminor);
|
|
||||||
enum SpwRetVal SiSyncGetNumberOfFunctions(SiHdl hdl, SPWuint32 *pnumberOfFunctions);
|
|
||||||
enum SpwRetVal SiSyncGetFunction(SiHdl hdl, SPWuint32 index, SPWint32 *pabsoluteFunctionNumber, WCHAR name[], SPWuint32 *pmaxNameLen);
|
|
||||||
enum SpwRetVal SiSyncGetButtonAssignment(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 *passignedFunctionIndex);
|
|
||||||
enum SpwRetVal SiSyncSetButtonAssignment(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 functionIndex);
|
|
||||||
enum SpwRetVal SiSyncSetButtonAssignmentAbsolute(SiHdl hdl, SPWuint32 buttonNumber, SPWint32 absoluteFunctionNumber );
|
|
||||||
enum SpwRetVal SiSyncSetButtonName(SiHdl hdl, SPWuint32 buttonNumber, WCHAR name[]);
|
|
||||||
enum SpwRetVal SiSyncGetAxisLabel (SiHdl hdl, SPWuint32 axisNumber, WCHAR name[], SPWuint32 *pmaxNameLen );
|
|
||||||
enum SpwRetVal SiSyncSetAxisLabel (SiHdl hdl, SPWuint32 axisNumber, WCHAR name[] );
|
|
||||||
enum SpwRetVal SiSyncGetOrientation (SiHdl hdl, SPWint32 axes[6] );
|
|
||||||
enum SpwRetVal SiSyncSetOrientation (SiHdl hdl, SPWint32 axes[6] );
|
|
||||||
enum SpwRetVal SiSyncGetFilter (SiHdl hdl, SiSyncFilter i, SiSyncFilterValue *pv );
|
|
||||||
enum SpwRetVal SiSyncSetFilter (SiHdl hdl, SiSyncFilter i, SiSyncFilterValue v );
|
|
||||||
enum SpwRetVal SiSyncGetAxesState (SiHdl hdl, SiSyncAxesState *pa );
|
|
||||||
enum SpwRetVal SiSyncSetAxesState (SiHdl hdl, SiSyncAxesState a );
|
|
||||||
enum SpwRetVal SiSyncSetInfoLine (SiHdl hdl, SPWint32 duration, WCHAR text[] );
|
|
||||||
enum SpwRetVal SiSyncGetScaleOverall (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleOverall (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleTx (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleTx (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleTy (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleTy (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleTz (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleTz (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleRx (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleRx (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleRy (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleRy (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncGetScaleRz (SiHdl hdl, SPWfloat32 *pv );
|
|
||||||
enum SpwRetVal SiSyncSetScaleRz (SiHdl hdl, SPWfloat32 v );
|
|
||||||
enum SpwRetVal SiSyncInvokeAbsoluteFunction (SiHdl hdl, SiSyncAbsFunctionNumber i );
|
|
||||||
enum SpwRetVal SiSyncSetButtonState (SiHdl hdl, SPWuint32 buttonNumber, SiSyncButtonState state );
|
|
||||||
enum SpwRetVal SiGetButtonName (SiHdl hdl, SPWuint32 buttonNumber, SiButtonName *pname);
|
|
||||||
enum SpwRetVal SiGetDeviceName (SiHdl hdl, SiDeviceName *pname);
|
|
||||||
enum SpwRetVal SiGetDeviceImageFileName (SiHdl hdl, char name[], SPWuint32 *pmaxNameLen);
|
|
||||||
HICON SiGetCompanyIcon(void);
|
|
||||||
enum SpwRetVal SiGetCompanyLogoFileName (char name[], SPWuint32 *pmaxNameLen);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* #ifndef SIAPP_H */
|
|
|
@ -1,63 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* spwdata.h -- datatypes
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Id: spwdata.h,v 1.4 1996/10/08 23:01:39 chris Exp $
|
|
||||||
*
|
|
||||||
* This contains the only acceptable type definitions for 3Dconnexion
|
|
||||||
* products. Needs more work.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (c) 1996-2005 3Dconnexion. All rights reserved.
|
|
||||||
*
|
|
||||||
* The computer codes included in this file, including source code and
|
|
||||||
* object code, constitutes the proprietary and confidential information of
|
|
||||||
* 3Dconnexion, and are provided pursuant to a license
|
|
||||||
* agreement. These computer codes are protected by international, federal
|
|
||||||
* and state law, including United States Copyright Law and international
|
|
||||||
* treaty provisions. Except as expressly authorized by the license
|
|
||||||
* agreement, or as expressly permitted under applicable laws of member
|
|
||||||
* states of the European Union and then only to the extent so permitted,
|
|
||||||
* no part of these computer codes may be reproduced or transmitted in any
|
|
||||||
* form or by any means, electronic or mechanical, modified, decompiled,
|
|
||||||
* disassembled, reverse engineered, sold, transferred, rented or utilized
|
|
||||||
* for any unauthorized purpose without the express written permission of
|
|
||||||
* 3Dconnexion.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SPWDATA_H
|
|
||||||
#define SPWDATA_H
|
|
||||||
|
|
||||||
static char spwdataCvsId[]="(C) 1996-2005 3Dconnexion: $Id: spwdata.h,v 1.4 1996/10/08 23:01:39 chris Exp $";
|
|
||||||
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
#define tchar_t _TCHAR
|
|
||||||
#define char_t char
|
|
||||||
#define uint32_t unsigned long
|
|
||||||
#define sint32_t long
|
|
||||||
#define boolean_t unsigned char
|
|
||||||
#define void_t void
|
|
||||||
#define window_handle_t HWND
|
|
||||||
|
|
||||||
|
|
||||||
typedef long SPWint32;
|
|
||||||
typedef short SPWint16;
|
|
||||||
typedef char SPWint8;
|
|
||||||
typedef int SPWbool;
|
|
||||||
typedef unsigned long SPWuint32;
|
|
||||||
typedef unsigned short SPWuint16;
|
|
||||||
typedef unsigned char SPWuint8;
|
|
||||||
typedef _TCHAR SPWchar;
|
|
||||||
typedef _TCHAR* SPWstring;
|
|
||||||
typedef float SPWfloat32;
|
|
||||||
typedef double SPWfloat64;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* SPWDATA_H */
|
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* spwerror.h -- Standard Spacetec IMC function return values
|
|
||||||
*
|
|
||||||
* $Id: spwerror.h,v 1.10.4.1 1998/05/26 17:30:21 equerze Exp $
|
|
||||||
*
|
|
||||||
* This file contains all the Spacetec IMC standard error return
|
|
||||||
* return values for functions
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* (C) 1998-2001 3Dconnexion. All rights reserved.
|
|
||||||
* Permission to use, copy, modify, and distribute this software for all
|
|
||||||
* purposes and without fees is hereby grated provided that this copyright
|
|
||||||
* notice appears in all copies. Permission to modify this software is granted
|
|
||||||
* and 3Dconnexion will support such modifications only is said modifications are
|
|
||||||
* approved by 3Dconnexion.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SPWERROR_H_
|
|
||||||
#define _SPWERROR_H_
|
|
||||||
|
|
||||||
#include "spwdata.h"
|
|
||||||
|
|
||||||
static char spwerrorCvsId[]="(C) 1996 Spacetec IMC Corporation: $Id: spwerror.h,v 1.10.4.1 1998/05/26 17:30:21 equerze Exp $";
|
|
||||||
|
|
||||||
enum SpwRetVal /* Error return values. */
|
|
||||||
{
|
|
||||||
SPW_NO_ERROR, /* No error. */
|
|
||||||
SPW_ERROR, /* Error -- function failed. */
|
|
||||||
SI_BAD_HANDLE, /* Invalid SpaceWare handle. */
|
|
||||||
SI_BAD_ID, /* Invalid device ID. */
|
|
||||||
SI_BAD_VALUE, /* Invalid argument value. */
|
|
||||||
SI_IS_EVENT, /* Event is a SpaceWare event. */
|
|
||||||
SI_SKIP_EVENT, /* Skip this SpaceWare event. */
|
|
||||||
SI_NOT_EVENT, /* Event is not a SpaceWare event. */
|
|
||||||
SI_NO_DRIVER, /* SpaceWare driver is not running. */
|
|
||||||
SI_NO_RESPONSE, /* SpaceWare driver is not responding. */
|
|
||||||
SI_UNSUPPORTED, /* The function is unsupported by this version. */
|
|
||||||
SI_UNINITIALIZED, /* SpaceWare input library is uninitialized. */
|
|
||||||
SI_WRONG_DRIVER, /* Driver is incorrect for this SpaceWare version.*/
|
|
||||||
SI_INTERNAL_ERROR, /* Internal SpaceWare error. */
|
|
||||||
SI_BAD_PROTOCOL, /* The transport protocol is unknown. */
|
|
||||||
SI_OUT_OF_MEMORY, /* Unable to malloc space required. */
|
|
||||||
SPW_DLL_LOAD_ERROR, /* Could not load siapp dlls */
|
|
||||||
SI_NOT_OPEN, /* Spaceball device not open */
|
|
||||||
SI_ITEM_NOT_FOUND, /* Item not found */
|
|
||||||
SI_UNSUPPORTED_DEVICE, /* The device is not supported */
|
|
||||||
SI_NOT_ENOUGH_MEMORY, /* Not enough memory (but not a malloc problem) */
|
|
||||||
SI_SYNC_WRONG_HASHCODE /* Wrong hash code sent to a Sync function */
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum SpwRetVal SpwReturnValue;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SPWERROR_H_ */
|
|
|
@ -1,48 +0,0 @@
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
* spwmacro.h -- cpp macros we ALWAYS use.
|
|
||||||
*
|
|
||||||
<<<<<<< spwmacro.h
|
|
||||||
* $Id: spwmacro.h,v 1.3 2001/01/16 01:18:40 HJin Exp $
|
|
||||||
=======
|
|
||||||
* $Id: spwmacro.h,v 1.3 2001/01/16 01:18:40 HJin Exp $
|
|
||||||
>>>>>>> 1.1.1.1.4.1
|
|
||||||
*
|
|
||||||
* We always seem to use the same macros.
|
|
||||||
* This is the place we define them.
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SPWMACRO_H
|
|
||||||
#define SPWMACRO_H
|
|
||||||
|
|
||||||
|
|
||||||
#define SPW_FALSE (0)
|
|
||||||
#define SPW_TRUE (!SPW_FALSE)
|
|
||||||
|
|
||||||
#define SPW_MAX(a,b) (((a)>(b))?(a):(b))
|
|
||||||
#define SPW_MIN(a,b) (((a)<(b))?(a):(b))
|
|
||||||
|
|
||||||
#define SPW_ABS(a) (((a)<0)?(-(a)):(a))
|
|
||||||
|
|
||||||
#define SPW_SIGN(a) ((a)>=0?1:-1)
|
|
||||||
|
|
||||||
#define SPW_BIND(min,n,max) (SPW_MIN((max),SPW_MAX((min),(n))))
|
|
||||||
|
|
||||||
#define SPW_NUM_ELEMENTS_IN(a) (sizeof(a)/sizeof((a)[0]))
|
|
||||||
|
|
||||||
#define SPW_PI 3.14159265358979324f
|
|
||||||
|
|
||||||
#define SPW_DEG_TO_RAD(d) ((d)*SPW_PI/180.0f)
|
|
||||||
#define SPW_RAD_TO_DEG(r) ((r)*180.0f/SPW_PI)
|
|
||||||
|
|
||||||
#define SPW_LENGTH_OF(a) (sizeof(a)/sizeof((a)[0]))
|
|
||||||
|
|
||||||
#define SPW_END_OF(a) (&(a)[SPW_LENGTH_OF(a)-1])
|
|
||||||
|
|
||||||
#define SPW_SQ(a) ((a)*(a))
|
|
||||||
|
|
||||||
#define SPW_ABSDIFF(a, b) (fabs((double) (a) - (b)))
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 2fa463bacfff79181df1a5270fb67cc679a53e71
|
|
224
include/slvs.h
|
@ -1,42 +1,38 @@
|
||||||
/*-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
* Data structures and prototypes for slvs.lib, a geometric constraint solver.
|
// Data structures and prototypes for slvs.lib, a geometric constraint solver.
|
||||||
*
|
//
|
||||||
* See the comments in this file, the accompanying sample code that uses
|
// See the comments in this file, the accompanying sample code that uses
|
||||||
* this library, and the accompanying documentation (DOC.txt).
|
// this library, and the accompanying documentation (DOC.txt).
|
||||||
*
|
//
|
||||||
* Copyright 2009-2013 Jonathan Westhues.
|
// Copyright 2009-2013 Jonathan Westhues.
|
||||||
*---------------------------------------------------------------------------*/
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef __SLVS_H
|
#ifndef __SLVS_H
|
||||||
#define __SLVS_H
|
#define __SLVS_H
|
||||||
|
|
||||||
#ifdef WIN32
|
#include <stdint.h>
|
||||||
# ifdef EXPORT_DLL
|
|
||||||
# define DLL __declspec( dllexport )
|
#if defined(WIN32)
|
||||||
# else
|
#ifdef slvs_EXPORTS
|
||||||
# define DLL __declspec( dllimport )
|
#define DLL __declspec( dllexport )
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
# define DLL
|
#define DLL __declspec( dllimport )
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define DLL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
#else
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef uint32_t Slvs_hParam;
|
typedef uint32_t Slvs_hParam;
|
||||||
typedef uint32_t Slvs_hEntity;
|
typedef uint32_t Slvs_hEntity;
|
||||||
typedef uint32_t Slvs_hConstraint;
|
typedef uint32_t Slvs_hConstraint;
|
||||||
typedef uint32_t Slvs_hGroup;
|
typedef uint32_t Slvs_hGroup;
|
||||||
|
|
||||||
/* To obtain the 3d (not projected into a workplane) of a constraint or
|
// To obtain the 3d (not projected into a workplane) of a constraint or
|
||||||
* an entity, specify this instead of the workplane. */
|
// an entity, specify this instead of the workplane.
|
||||||
#define SLVS_FREE_IN_3D 0
|
#define SLVS_FREE_IN_3D 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,9 +51,9 @@ typedef struct {
|
||||||
|
|
||||||
#define SLVS_E_DISTANCE 70000
|
#define SLVS_E_DISTANCE 70000
|
||||||
|
|
||||||
/* The special point, normal, and distance types used for parametric step
|
// The special point, normal, and distance types used for parametric step
|
||||||
* and repeat, extrude, and assembly are currently not exposed. Please
|
// and repeat, extrude, and assembly are currently not exposed. Please
|
||||||
* contact us if you are interested in using these. */
|
// contact us if you are interested in using these.
|
||||||
|
|
||||||
#define SLVS_E_WORKPLANE 80000
|
#define SLVS_E_WORKPLANE 80000
|
||||||
#define SLVS_E_LINE_SEGMENT 80001
|
#define SLVS_E_LINE_SEGMENT 80001
|
||||||
|
@ -112,7 +108,6 @@ typedef struct {
|
||||||
#define SLVS_C_PROJ_PT_DISTANCE 100030
|
#define SLVS_C_PROJ_PT_DISTANCE 100030
|
||||||
#define SLVS_C_WHERE_DRAGGED 100031
|
#define SLVS_C_WHERE_DRAGGED 100031
|
||||||
#define SLVS_C_CURVE_CURVE_TANGENT 100032
|
#define SLVS_C_CURVE_CURVE_TANGENT 100032
|
||||||
#define SLVS_C_LENGTH_DIFFERENCE 100033
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Slvs_hConstraint h;
|
Slvs_hConstraint h;
|
||||||
|
@ -136,15 +131,16 @@ typedef struct {
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/*** INPUT VARIABLES
|
//// INPUT VARIABLES
|
||||||
*
|
//
|
||||||
* Here, we specify the parameters and their initial values, the entities,
|
// Here, we specify the parameters and their initial values, the entities,
|
||||||
* and the constraints. For example, param[] points to the array of
|
// and the constraints. For example, param[] points to the array of
|
||||||
* parameters, which has length params, so that the last valid element
|
// parameters, which has length params, so that the last valid element
|
||||||
* is param[params-1].
|
// is param[params-1].
|
||||||
*
|
//
|
||||||
* param[] is actually an in/out variable; if the solver is successful,
|
// param[] is actually an in/out variable; if the solver is successful,
|
||||||
* then the new values (that satisfy the constraints) are written to it. */
|
// then the new values (that satisfy the constraints) are written to it.
|
||||||
|
//
|
||||||
Slvs_Param *param;
|
Slvs_Param *param;
|
||||||
int params;
|
int params;
|
||||||
Slvs_Entity *entity;
|
Slvs_Entity *entity;
|
||||||
|
@ -152,55 +148,56 @@ typedef struct {
|
||||||
Slvs_Constraint *constraint;
|
Slvs_Constraint *constraint;
|
||||||
int constraints;
|
int constraints;
|
||||||
|
|
||||||
/* If a parameter corresponds to a point (distance, normal, etc.) being
|
// If a parameter corresponds to a point (distance, normal, etc.) being
|
||||||
* dragged, then specify it here. This will cause the solver to favor
|
// dragged, then specify it here. This will cause the solver to favor
|
||||||
* that parameter, and attempt to change it as little as possible even
|
// that parameter, and attempt to change it as little as possible even
|
||||||
* if that requires it to change other parameters more.
|
// if that requires it to change other parameters more.
|
||||||
*
|
//
|
||||||
* Unused members of this array should be set to zero. */
|
// Unused members of this array should be set to zero.
|
||||||
Slvs_hParam dragged[4];
|
Slvs_hParam dragged[4];
|
||||||
|
|
||||||
/* If the solver fails, then it can determine which constraints are
|
// If the solver fails, then it can determine which constraints are
|
||||||
* causing the problem. But this is a relatively slow process (for
|
// causing the problem. But this is a relatively slow process (for
|
||||||
* a system with n constraints, about n times as long as just solving).
|
// a system with n constraints, about n times as long as just solving).
|
||||||
* If calculateFaileds is true, then the solver will do so, otherwise
|
// If calculateFaileds is true, then the solver will do so, otherwise
|
||||||
* not. */
|
// not.
|
||||||
int calculateFaileds;
|
int calculateFaileds;
|
||||||
|
|
||||||
/*** OUTPUT VARIABLES
|
//// OUTPUT VARIABLES
|
||||||
*
|
//
|
||||||
* If the solver fails, then it can report which constraints are causing
|
// If the solver fails, then it can report which constraints are causing
|
||||||
* the problem. The caller should allocate the array failed[], and pass
|
// the problem. The caller should allocate the array failed[], and pass
|
||||||
* its size in faileds.
|
// its size in faileds.
|
||||||
*
|
//
|
||||||
* The solver will set faileds equal to the number of problematic
|
// The solver will set faileds equal to the number of problematic
|
||||||
* constraints, and write their Slvs_hConstraints into failed[]. To
|
// constraints, and write their Slvs_hConstraints into failed[]. To
|
||||||
* ensure that there is sufficient space for any possible set of
|
// ensure that there is sufficient space for any possible set of
|
||||||
* failing constraints, faileds should be greater than or equal to
|
// failing constraints, faileds should be greater than or equal to
|
||||||
* constraints. */
|
// constraints.
|
||||||
Slvs_hConstraint *failed;
|
Slvs_hConstraint *failed;
|
||||||
int faileds;
|
int faileds;
|
||||||
|
|
||||||
/* The solver indicates the number of unconstrained degrees of freedom. */
|
// The solver indicates the number of unconstrained degrees of freedom.
|
||||||
int dof;
|
int dof;
|
||||||
|
|
||||||
/* The solver indicates whether the solution succeeded. */
|
// The solver indicates whether the solution succeeded.
|
||||||
#define SLVS_RESULT_OKAY 0
|
#define SLVS_RESULT_OKAY 0
|
||||||
#define SLVS_RESULT_INCONSISTENT 1
|
#define SLVS_RESULT_REDUNDANT_OKAY 1
|
||||||
#define SLVS_RESULT_DIDNT_CONVERGE 2
|
#define SLVS_RESULT_REDUNDANT_DIDNT_CONVERGE 2
|
||||||
#define SLVS_RESULT_TOO_MANY_UNKNOWNS 3
|
#define SLVS_RESULT_DIDNT_CONVERGE 3
|
||||||
|
#define SLVS_RESULT_TOO_MANY_UNKNOWNS 4
|
||||||
int result;
|
int result;
|
||||||
} Slvs_System;
|
} Slvs_System;
|
||||||
|
|
||||||
DLL void Slvs_Solve(Slvs_System *sys, Slvs_hGroup hg);
|
DLL void Slvs_Solve(Slvs_System *sys, Slvs_hGroup hg);
|
||||||
|
|
||||||
|
|
||||||
/* Our base coordinate system has basis vectors
|
// Our base coordinate system has basis vectors
|
||||||
* (1, 0, 0) (0, 1, 0) (0, 0, 1)
|
// (1, 0, 0) (0, 1, 0) (0, 0, 1)
|
||||||
* A unit quaternion defines a rotation to a new coordinate system with
|
// A unit quaternion defines a rotation to a new coordinate system with
|
||||||
* basis vectors
|
// basis vectors
|
||||||
* U V N
|
// U V N
|
||||||
* which these functions compute from the quaternion. */
|
// which these functions compute from the quaternion.
|
||||||
DLL void Slvs_QuaternionU(double qw, double qx, double qy, double qz,
|
DLL void Slvs_QuaternionU(double qw, double qx, double qy, double qz,
|
||||||
double *x, double *y, double *z);
|
double *x, double *y, double *z);
|
||||||
DLL void Slvs_QuaternionV(double qw, double qx, double qy, double qz,
|
DLL void Slvs_QuaternionV(double qw, double qx, double qy, double qz,
|
||||||
|
@ -208,18 +205,18 @@ DLL void Slvs_QuaternionV(double qw, double qx, double qy, double qz,
|
||||||
DLL void Slvs_QuaternionN(double qw, double qx, double qy, double qz,
|
DLL void Slvs_QuaternionN(double qw, double qx, double qy, double qz,
|
||||||
double *x, double *y, double *z);
|
double *x, double *y, double *z);
|
||||||
|
|
||||||
/* Similarly, compute a unit quaternion in terms of two basis vectors. */
|
// Similarly, compute a unit quaternion in terms of two basis vectors.
|
||||||
DLL void Slvs_MakeQuaternion(double ux, double uy, double uz,
|
DLL void Slvs_MakeQuaternion(double ux, double uy, double uz,
|
||||||
double vx, double vy, double vz,
|
double vx, double vy, double vz,
|
||||||
double *qw, double *qx, double *qy, double *qz);
|
double *qw, double *qx, double *qy, double *qz);
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------
|
//-------------------------------------
|
||||||
* These are just convenience functions, to save you the trouble of filling
|
// These are just convenience functions, to save you the trouble of filling
|
||||||
* out the structures by hand. The code is included in the header file to
|
// out the structures by hand. The code is included in the header file to
|
||||||
* let the compiler inline them if possible. */
|
// let the compiler inline them if possible.
|
||||||
|
|
||||||
static inline Slvs_Param Slvs_MakeParam(Slvs_hParam h, Slvs_hGroup group, double val)
|
static Slvs_Param Slvs_MakeParam(Slvs_hParam h, Slvs_hGroup group, double val)
|
||||||
{
|
{
|
||||||
Slvs_Param r;
|
Slvs_Param r;
|
||||||
r.h = h;
|
r.h = h;
|
||||||
|
@ -227,9 +224,9 @@ static inline Slvs_Param Slvs_MakeParam(Slvs_hParam h, Slvs_hGroup group, double
|
||||||
r.val = val;
|
r.val = val;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakePoint2d(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakePoint2d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
Slvs_hParam u, Slvs_hParam v)
|
Slvs_hParam u, Slvs_hParam v)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -241,8 +238,8 @@ static inline Slvs_Entity Slvs_MakePoint2d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.param[1] = v;
|
r.param[1] = v;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakePoint3d(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakePoint3d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hParam x, Slvs_hParam y, Slvs_hParam z)
|
Slvs_hParam x, Slvs_hParam y, Slvs_hParam z)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -255,9 +252,8 @@ static inline Slvs_Entity Slvs_MakePoint3d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.param[2] = z;
|
r.param[2] = z;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeNormal3d(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeNormal3d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hParam qw, Slvs_hParam qx,
|
Slvs_hParam qw, Slvs_hParam qx, Slvs_hParam qy, Slvs_hParam qz)
|
||||||
Slvs_hParam qy, Slvs_hParam qz)
|
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -271,8 +267,8 @@ static inline Slvs_Entity Slvs_MakeNormal3d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.param[3] = qz;
|
r.param[3] = qz;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeNormal2d(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeNormal2d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl)
|
Slvs_hEntity wrkpl)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -282,8 +278,8 @@ static inline Slvs_Entity Slvs_MakeNormal2d(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.wrkpl = wrkpl;
|
r.wrkpl = wrkpl;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeDistance(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeDistance(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl, Slvs_hParam d)
|
Slvs_hEntity wrkpl, Slvs_hParam d)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -294,9 +290,9 @@ static inline Slvs_Entity Slvs_MakeDistance(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.param[0] = d;
|
r.param[0] = d;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeLineSegment(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeLineSegment(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
Slvs_hEntity ptA, Slvs_hEntity ptB)
|
Slvs_hEntity ptA, Slvs_hEntity ptB)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -308,10 +304,10 @@ static inline Slvs_Entity Slvs_MakeLineSegment(Slvs_hEntity h, Slvs_hGroup group
|
||||||
r.point[1] = ptB;
|
r.point[1] = ptB;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeCubic(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeCubic(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
Slvs_hEntity pt0, Slvs_hEntity pt1,
|
Slvs_hEntity pt0, Slvs_hEntity pt1,
|
||||||
Slvs_hEntity pt2, Slvs_hEntity pt3)
|
Slvs_hEntity pt2, Slvs_hEntity pt3)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -325,11 +321,11 @@ static inline Slvs_Entity Slvs_MakeCubic(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.point[3] = pt3;
|
r.point[3] = pt3;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeArcOfCircle(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeArcOfCircle(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
Slvs_hEntity normal,
|
Slvs_hEntity normal,
|
||||||
Slvs_hEntity center,
|
Slvs_hEntity center,
|
||||||
Slvs_hEntity start, Slvs_hEntity end)
|
Slvs_hEntity start, Slvs_hEntity end)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -343,10 +339,10 @@ static inline Slvs_Entity Slvs_MakeArcOfCircle(Slvs_hEntity h, Slvs_hGroup group
|
||||||
r.point[2] = end;
|
r.point[2] = end;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeCircle(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeCircle(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
Slvs_hEntity center,
|
Slvs_hEntity center,
|
||||||
Slvs_hEntity normal, Slvs_hEntity radius)
|
Slvs_hEntity normal, Slvs_hEntity radius)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -359,8 +355,8 @@ static inline Slvs_Entity Slvs_MakeCircle(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
r.distance = radius;
|
r.distance = radius;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static inline Slvs_Entity Slvs_MakeWorkplane(Slvs_hEntity h, Slvs_hGroup group,
|
static Slvs_Entity Slvs_MakeWorkplane(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
Slvs_hEntity origin, Slvs_hEntity normal)
|
Slvs_hEntity origin, Slvs_hEntity normal)
|
||||||
{
|
{
|
||||||
Slvs_Entity r;
|
Slvs_Entity r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
@ -373,15 +369,15 @@ static inline Slvs_Entity Slvs_MakeWorkplane(Slvs_hEntity h, Slvs_hGroup group,
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline Slvs_Constraint Slvs_MakeConstraint(Slvs_hConstraint h,
|
static Slvs_Constraint Slvs_MakeConstraint(Slvs_hConstraint h,
|
||||||
Slvs_hGroup group,
|
Slvs_hGroup group,
|
||||||
int type,
|
int type,
|
||||||
Slvs_hEntity wrkpl,
|
Slvs_hEntity wrkpl,
|
||||||
double valA,
|
double valA,
|
||||||
Slvs_hEntity ptA,
|
Slvs_hEntity ptA,
|
||||||
Slvs_hEntity ptB,
|
Slvs_hEntity ptB,
|
||||||
Slvs_hEntity entityA,
|
Slvs_hEntity entityA,
|
||||||
Slvs_hEntity entityB)
|
Slvs_hEntity entityB)
|
||||||
{
|
{
|
||||||
Slvs_Constraint r;
|
Slvs_Constraint r;
|
||||||
memset(&r, 0, sizeof(r));
|
memset(&r, 0, sizeof(r));
|
||||||
|
|
|
@ -1,232 +0,0 @@
|
||||||
# First, set up registration functions for the kinds of resources we handle.
|
|
||||||
set(resource_root ${CMAKE_CURRENT_SOURCE_DIR}/)
|
|
||||||
set(resource_list)
|
|
||||||
if(WIN32)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/win32/versioninfo.rc.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc)
|
|
||||||
|
|
||||||
set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc)
|
|
||||||
file(WRITE ${rc_file} "// Autogenerated; do not edit\n")
|
|
||||||
file(APPEND ${rc_file} "#include <windows.h>\n")
|
|
||||||
file(APPEND ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n")
|
|
||||||
|
|
||||||
function(add_resource name)
|
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
|
|
||||||
|
|
||||||
if(${ARGC} GREATER 1)
|
|
||||||
set(id ${ARGV1})
|
|
||||||
else()
|
|
||||||
string(REPLACE ${resource_root} "" id ${source})
|
|
||||||
endif()
|
|
||||||
if(${ARGC} GREATER 2)
|
|
||||||
set(type ${ARGV2})
|
|
||||||
else()
|
|
||||||
set(type RCDATA)
|
|
||||||
endif()
|
|
||||||
file(SHA512 "${source}" hash)
|
|
||||||
file(APPEND ${rc_file} "${id} ${type} \"${source}\" // ${hash}\n")
|
|
||||||
# CMake doesn't track file dependencies across directories, so we force
|
|
||||||
# a reconfigure (which changes the RC file because of the hash above)
|
|
||||||
# every time a resource is changed.
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${source}")
|
|
||||||
endfunction()
|
|
||||||
elseif(APPLE)
|
|
||||||
set(app_resource_dir ${CMAKE_BINARY_DIR}/bin/solvespace.app/Contents/Resources)
|
|
||||||
set(cli_resource_dir ${CMAKE_BINARY_DIR}/res)
|
|
||||||
|
|
||||||
function(add_resource name)
|
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
|
|
||||||
set(target_app ${app_resource_dir}/${name})
|
|
||||||
set(target_cli ${cli_resource_dir}/${name})
|
|
||||||
set(resource_list "${resource_list};${target_app};${target_cli}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
get_filename_component(target_app_dir ${target_app} DIRECTORY)
|
|
||||||
get_filename_component(target_cli_dir ${target_cli} DIRECTORY)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${target_app} ${target_cli}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${target_app_dir}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${source} ${target_app}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${target_cli_dir}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${source} ${target_cli}
|
|
||||||
COMMENT "Copying resource ${name}"
|
|
||||||
DEPENDS ${source}
|
|
||||||
VERBATIM)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(add_xib name)
|
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
|
|
||||||
get_filename_component(basename ${name} NAME_WE)
|
|
||||||
set(target ${app_resource_dir}/${basename}.nib)
|
|
||||||
set(resource_list "${resource_list};${target}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${target}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${app_resource_dir}
|
|
||||||
COMMAND ibtool --errors --warnings --notices --output-format human-readable-text
|
|
||||||
--compile ${target} ${source}
|
|
||||||
COMMENT "Building Interface Builder file ${name}"
|
|
||||||
DEPENDS ${source}
|
|
||||||
VERBATIM)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(add_iconset name)
|
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
|
|
||||||
get_filename_component(basename ${name} NAME_WE)
|
|
||||||
set(target ${app_resource_dir}/${basename}.icns)
|
|
||||||
set(resource_list "${resource_list};${target}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${target}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${app_resource_dir}
|
|
||||||
COMMAND iconutil -c icns -o ${target} ${source}
|
|
||||||
COMMENT "Building icon set ${name}"
|
|
||||||
DEPENDS ${source}
|
|
||||||
VERBATIM)
|
|
||||||
endfunction()
|
|
||||||
else() # Unix
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
set(app_resource_dir ${CMAKE_BINARY_DIR}/res)
|
|
||||||
|
|
||||||
function(add_resource name)
|
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
|
|
||||||
set(target ${app_resource_dir}/${name})
|
|
||||||
set(resource_list "${resource_list};${target}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
get_filename_component(target_dir ${target} DIRECTORY)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${target}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${target_dir}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${source} ${target}
|
|
||||||
COMMENT "Copying resource ${name}"
|
|
||||||
DEPENDS ${source}
|
|
||||||
VERBATIM)
|
|
||||||
|
|
||||||
get_filename_component(name_dir ${name} DIRECTORY)
|
|
||||||
install(FILES ${source}
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/solvespace/${name_dir})
|
|
||||||
endfunction()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
function(add_resources)
|
|
||||||
foreach(name ${ARGN})
|
|
||||||
add_resource(${name})
|
|
||||||
set(resource_list "${resource_list}" PARENT_SCOPE)
|
|
||||||
endforeach()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Second, register all resources.
|
|
||||||
if(WIN32)
|
|
||||||
add_resource(win32/icon.ico 4000 ICON)
|
|
||||||
add_resource(win32/manifest.xml 2 RT_MANIFEST)
|
|
||||||
elseif(APPLE)
|
|
||||||
add_iconset (cocoa/AppIcon.iconset)
|
|
||||||
add_xib (cocoa/MainMenu.xib)
|
|
||||||
add_xib (cocoa/SaveFormatAccessory.xib)
|
|
||||||
else()
|
|
||||||
add_resource(freedesktop/solvespace-48x48.png)
|
|
||||||
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/freedesktop/solvespace.desktop.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop)
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freedesktop/solvespace.desktop
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
|
||||||
|
|
||||||
foreach(SIZE 16x16 24x24 32x32 48x48)
|
|
||||||
install(FILES freedesktop/solvespace-${SIZE}.png
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/apps
|
|
||||||
RENAME solvespace.png)
|
|
||||||
install(FILES freedesktop/solvespace-${SIZE}.png
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}/mimetypes
|
|
||||||
RENAME application.x-solvespace.png)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(SIZE 16x16 24x24 32x32 48x48)
|
|
||||||
install(FILES freedesktop/solvespace-${SIZE}.xpm
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_resources(
|
|
||||||
banner.txt
|
|
||||||
icons/graphics-window/angle.png
|
|
||||||
icons/graphics-window/arc.png
|
|
||||||
icons/graphics-window/assemble.png
|
|
||||||
icons/graphics-window/bezier.png
|
|
||||||
icons/graphics-window/circle.png
|
|
||||||
icons/graphics-window/construction.png
|
|
||||||
icons/graphics-window/equal.png
|
|
||||||
icons/graphics-window/extrude.png
|
|
||||||
icons/graphics-window/horiz.png
|
|
||||||
icons/graphics-window/image.png
|
|
||||||
icons/graphics-window/in3d.png
|
|
||||||
icons/graphics-window/lathe.png
|
|
||||||
icons/graphics-window/length.png
|
|
||||||
icons/graphics-window/line.png
|
|
||||||
icons/graphics-window/ontoworkplane.png
|
|
||||||
icons/graphics-window/other-supp.png
|
|
||||||
icons/graphics-window/parallel.png
|
|
||||||
icons/graphics-window/perpendicular.png
|
|
||||||
icons/graphics-window/pointonx.png
|
|
||||||
icons/graphics-window/point.png
|
|
||||||
icons/graphics-window/rectangle.png
|
|
||||||
icons/graphics-window/ref.png
|
|
||||||
icons/graphics-window/same-orientation.png
|
|
||||||
icons/graphics-window/sketch-in-3d.png
|
|
||||||
icons/graphics-window/sketch-in-plane.png
|
|
||||||
icons/graphics-window/step-rotate.png
|
|
||||||
icons/graphics-window/step-translate.png
|
|
||||||
icons/graphics-window/symmetric.png
|
|
||||||
icons/graphics-window/tangent-arc.png
|
|
||||||
icons/graphics-window/text.png
|
|
||||||
icons/graphics-window/trim.png
|
|
||||||
icons/graphics-window/vert.png
|
|
||||||
icons/text-window/constraint.png
|
|
||||||
icons/text-window/edges.png
|
|
||||||
icons/text-window/faces.png
|
|
||||||
icons/text-window/occluded-visible.png
|
|
||||||
icons/text-window/occluded-stippled.png
|
|
||||||
icons/text-window/occluded-invisible.png
|
|
||||||
icons/text-window/mesh.png
|
|
||||||
icons/text-window/normal.png
|
|
||||||
icons/text-window/outlines.png
|
|
||||||
icons/text-window/point.png
|
|
||||||
icons/text-window/shaded.png
|
|
||||||
icons/text-window/workplane.png
|
|
||||||
locales.txt
|
|
||||||
locales/en_US.po
|
|
||||||
locales/uk_UA.po
|
|
||||||
fonts/unifont.hex.gz
|
|
||||||
fonts/private/0-check-false.png
|
|
||||||
fonts/private/1-check-true.png
|
|
||||||
fonts/private/2-radio-false.png
|
|
||||||
fonts/private/3-radio-true.png
|
|
||||||
fonts/private/4-stipple-dot.png
|
|
||||||
fonts/private/5-stipple-dash-long.png
|
|
||||||
fonts/private/6-stipple-dash.png
|
|
||||||
fonts/private/7-stipple-zigzag.png
|
|
||||||
fonts/unicode.lff.gz
|
|
||||||
shaders/imesh.frag
|
|
||||||
shaders/imesh.vert
|
|
||||||
shaders/imesh_point.frag
|
|
||||||
shaders/imesh_point.vert
|
|
||||||
shaders/imesh_tex.frag
|
|
||||||
shaders/imesh_texa.frag
|
|
||||||
shaders/imesh_tex.vert
|
|
||||||
shaders/mesh.frag
|
|
||||||
shaders/mesh.vert
|
|
||||||
shaders/mesh_fill.frag
|
|
||||||
shaders/mesh_fill.vert
|
|
||||||
shaders/edge.frag
|
|
||||||
shaders/edge.vert
|
|
||||||
shaders/outline.vert
|
|
||||||
threejs/three-r76.js.gz
|
|
||||||
threejs/hammer-2.0.8.js.gz
|
|
||||||
threejs/SolveSpaceControls.js)
|
|
||||||
|
|
||||||
# Third, distribute the resources.
|
|
||||||
add_custom_target(resources
|
|
||||||
DEPENDS ${resource_list})
|
|
||||||
if(WIN32)
|
|
||||||
set_property(TARGET resources PROPERTY EXTRA_SOURCES ${rc_file})
|
|
||||||
endif()
|
|
|
@ -1 +0,0 @@
|
||||||
SolveSpace!
|
|
Before Width: | Height: | Size: 891 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 626 B |
Before Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.3 KiB |
|
@ -1,65 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
|
||||||
<dependencies>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
|
||||||
</dependencies>
|
|
||||||
<objects>
|
|
||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
|
|
||||||
<customObject id="-3" userLabel="Application"/>
|
|
||||||
<customObject id="-4" userLabel="Application Delegate" customClass="ApplicationDelegate"/>
|
|
||||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
|
||||||
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
|
||||||
<items>
|
|
||||||
<menuItem title="SolveSpace" id="1Xt-HY-uBw">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
<menu key="submenu" title="SolveSpace" systemMenu="apple" id="uQy-DD-JDr">
|
|
||||||
<items>
|
|
||||||
<menuItem title="About SolveSpace" id="5kV-Vb-QxS">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
<connections>
|
|
||||||
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
|
||||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
|
|
||||||
<connections>
|
|
||||||
<action selector="preferences:" target="-4" id="xyv-2f-7kO"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
|
||||||
<menuItem title="Services" id="NMo-om-nkz">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
|
||||||
<menuItem title="Hide SolveSpace" keyEquivalent="h" id="Olw-nP-bQN">
|
|
||||||
<connections>
|
|
||||||
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
|
||||||
<connections>
|
|
||||||
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
<connections>
|
|
||||||
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
|
||||||
<menuItem title="Quit SolveSpace" keyEquivalent="q" id="4sb-4s-VLi">
|
|
||||||
<connections>
|
|
||||||
<action selector="terminate:" target="-3" id="Te7-pn-YzF"/>
|
|
||||||
</connections>
|
|
||||||
</menuItem>
|
|
||||||
</items>
|
|
||||||
</menu>
|
|
||||||
</menuItem>
|
|
||||||
</items>
|
|
||||||
</menu>
|
|
||||||
</objects>
|
|
||||||
</document>
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
|
||||||
<dependencies>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
|
||||||
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
|
|
||||||
</dependencies>
|
|
||||||
<objects>
|
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="NSViewController">
|
|
||||||
<connections>
|
|
||||||
<outlet property="button" destination="nNy-fR-AhK" id="w3z-a4-Khs"/>
|
|
||||||
<outlet property="view" destination="c22-O7-iKe" id="w2z-a4-Khs"/>
|
|
||||||
</connections>
|
|
||||||
</customObject>
|
|
||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
|
||||||
<customObject id="-3" userLabel="Application"/>
|
|
||||||
<customView id="c22-O7-iKe">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="294" height="51"/>
|
|
||||||
<subviews>
|
|
||||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nNy-fR-AhK">
|
|
||||||
<rect key="frame" x="105" y="12" width="34" height="26"/>
|
|
||||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="f8z-Qp-Igm">
|
|
||||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
|
||||||
<font key="font" metaFont="menu"/>
|
|
||||||
<menu key="menu" title="OtherViews" id="VgN-HZ-Q4a"/>
|
|
||||||
</popUpButtonCell>
|
|
||||||
<connections>
|
|
||||||
<binding destination="-2" name="selectedIndex" keyPath="index" id="AXx-uh-tee"/>
|
|
||||||
</connections>
|
|
||||||
</popUpButton>
|
|
||||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="z9Z-cA-QIW">
|
|
||||||
<rect key="frame" x="17" y="17" width="73" height="17"/>
|
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="File Format:" id="2vD-ht-BhF">
|
|
||||||
<font key="font" metaFont="system"/>
|
|
||||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
|
||||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
|
||||||
</textFieldCell>
|
|
||||||
</textField>
|
|
||||||
</subviews>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="nNy-fR-AhK" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="15" id="B3P-9V-lvu"/>
|
|
||||||
<constraint firstItem="nNy-fR-AhK" firstAttribute="leading" secondItem="z9Z-cA-QIW" secondAttribute="trailing" constant="20" id="Uex-s1-7UF"/>
|
|
||||||
<constraint firstAttribute="bottom" secondItem="nNy-fR-AhK" secondAttribute="bottom" constant="15" id="pPM-eQ-gOD"/>
|
|
||||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="nNy-fR-AhK" secondAttribute="trailing" constant="20" id="rPT-bl-Md7"/>
|
|
||||||
<constraint firstItem="z9Z-cA-QIW" firstAttribute="baseline" secondItem="nNy-fR-AhK" secondAttribute="baseline" constant="1" id="spD-eU-Frq"/>
|
|
||||||
<constraint firstItem="nNy-fR-AhK" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="centerX" constant="-40" id="whX-1w-qMB"/>
|
|
||||||
</constraints>
|
|
||||||
</customView>
|
|
||||||
<userDefaultsController representsSharedInstance="YES" id="ybp-e7-hms"/>
|
|
||||||
</objects>
|
|
||||||
</document>
|
|
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 950 B |
Before Width: | Height: | Size: 336 B |
|
@ -1,27 +0,0 @@
|
||||||
/* XPM */
|
|
||||||
static char *solvespace_16x16[] = {
|
|
||||||
/* columns rows colors chars-per-pixel */
|
|
||||||
"16 16 5 1 ",
|
|
||||||
" c black",
|
|
||||||
". c #1ED500",
|
|
||||||
"X c #DE00D6",
|
|
||||||
"o c #CBCBCB",
|
|
||||||
"O c None",
|
|
||||||
/* pixels */
|
|
||||||
"OOO OOOOOOOOOOOO",
|
|
||||||
"OOO OOOOOOOOOOOO",
|
|
||||||
"OOO OOOOOOOOOOOO",
|
|
||||||
"OOO OOOOOXOOOOOO",
|
|
||||||
"OOO OOOOOXoOOOOO",
|
|
||||||
"OOO OOOOOXoOOOOO",
|
|
||||||
"OOO OOOOOXoOOOOO",
|
|
||||||
"OOO OOOOOXoOOOOO",
|
|
||||||
"OOO OOOOOXoOOOOO",
|
|
||||||
"OOO OOXXXXXXXOOO",
|
|
||||||
"OOO OOOoooooooOO",
|
|
||||||
"OO...OOOOOOOOOOO",
|
|
||||||
" ... ",
|
|
||||||
"OO...OOOOOOOOOOO",
|
|
||||||
"OOO OOOOOOOOOOOO",
|
|
||||||
"OOO OOOOOOOOOOOO"
|
|
||||||
};
|
|
Before Width: | Height: | Size: 338 B |
|
@ -1,35 +0,0 @@
|
||||||
/* XPM */
|
|
||||||
static char *solvespace_24x24[] = {
|
|
||||||
/* columns rows colors chars-per-pixel */
|
|
||||||
"24 24 5 1 ",
|
|
||||||
" c black",
|
|
||||||
". c #1ED500",
|
|
||||||
"X c #DE00D6",
|
|
||||||
"o c #CBCBCB",
|
|
||||||
"O c None",
|
|
||||||
/* pixels */
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXoOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXoOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXoOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXoOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOXoOOOOOOOOO",
|
|
||||||
"OOOOOOO OOXXXXXXXOOOOOOO",
|
|
||||||
"OOOOOOO OOOoooooooOOOOOO",
|
|
||||||
"OOOOOO...OOOOOOOOOOOOOOO",
|
|
||||||
"OOOO ... OOOO",
|
|
||||||
"OOOOOO...OOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOO OOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOO"
|
|
||||||
};
|
|
Before Width: | Height: | Size: 348 B |
|
@ -1,43 +0,0 @@
|
||||||
/* XPM */
|
|
||||||
static char *solvespace_32x32[] = {
|
|
||||||
/* columns rows colors chars-per-pixel */
|
|
||||||
"32 32 5 1 ",
|
|
||||||
" c black",
|
|
||||||
". c #1ED500",
|
|
||||||
"X c #DE00D6",
|
|
||||||
"o c #CBCBCB",
|
|
||||||
"O c None",
|
|
||||||
/* pixels */
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOXXoOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOXXXXXXXXXXXXOOOOOOOO",
|
|
||||||
"OOOOOO OOOOXXXXXXXXXXXXOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOooooooooooooOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOO......OOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOO......OOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
" ...... ",
|
|
||||||
" ...... ",
|
|
||||||
"OOOO......OOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOO......OOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOO OOOOOOOOOOOOOOOOOOOOOOOO"
|
|
||||||
};
|
|
Before Width: | Height: | Size: 352 B |
|
@ -1,59 +0,0 @@
|
||||||
/* XPM */
|
|
||||||
static char *solvespace_48x48[] = {
|
|
||||||
/* columns rows colors chars-per-pixel */
|
|
||||||
"48 48 5 1 ",
|
|
||||||
" c black",
|
|
||||||
". c #1ED500",
|
|
||||||
"X c #DE00D6",
|
|
||||||
"o c #CBCBCB",
|
|
||||||
"O c None",
|
|
||||||
/* pixels */
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOXXoOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOXXXXXXXXXXXXOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOXXXXXXXXXXXXOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOooooooooooooOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOO......OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOO......OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOO ...... OOOOOOOO",
|
|
||||||
"OOOOOOOO ...... OOOOOOOO",
|
|
||||||
"OOOOOOOOOOOO......OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOO......OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
|
|
||||||
"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
|
|
||||||
};
|
|
|
@ -1,9 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Version=1.0
|
|
||||||
Name=SolveSpace
|
|
||||||
Comment=A parametric 2d/3d CAD
|
|
||||||
Exec=${CMAKE_INSTALL_FULL_BINDIR}/solvespace
|
|
||||||
Icon=solvespace
|
|
||||||
Type=Application
|
|
||||||
Categories=Graphics
|
|
||||||
Keywords=parametric;cad;2d;3d;
|
|
Before Width: | Height: | Size: 819 B |
Before Width: | Height: | Size: 686 B |
Before Width: | Height: | Size: 454 B |
Before Width: | Height: | Size: 710 B |
Before Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 739 B |
Before Width: | Height: | Size: 920 B |
Before Width: | Height: | Size: 620 B |
Before Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 916 B |
Before Width: | Height: | Size: 531 B |
Before Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 413 B |