Compare commits

..

2034 Commits

Author SHA1 Message Date
Yorik van Havre ca7c5d31a4 updated translations 2016-04-06 22:39:34 -03:00
wwmayer 00c8ad4698 Merge pull request #133 from bblacey/unified
Added OS X to Travis build configuration for unified Linux & OS X CI builds
2016-04-06 18:32:21 +02:00
Bruce B. Lacey e4c9451685 Added OS X to Travis build configuration for unified Linux & OS X CI builds and modified README.md to display build status 2016-04-06 08:40:43 -07:00
wwmayer db2580088d Merge pull request #132 from mandeeps708/master
fixes typo in Part Design workbench
2016-04-06 17:28:04 +02:00
mandeeps708 c1b652f21e fixes typo in Part Design workbench 2016-04-06 02:51:03 +05:30
Eivind Kvedalen 8fe0d42450 Spreadsheet: Fixed undo/redo (issue #2483). 2016-04-04 19:58:19 +02:00
wmayer 87293fac9b + add extra check if fillet operation returns valid shape 2016-04-04 14:26:27 +02:00
wmayer f7322989df + add convenience methods to SoQTQuarterAdaptor 2016-04-04 12:53:06 +02:00
wmayer a4f0f5c129 + fix crash when viewer has no camera 2016-04-04 12:48:58 +02:00
Yorik van Havre 3003f16389 Arch: fixed wrong storing of IFC uid in FreeCAD objects 2016-04-03 13:05:30 -03:00
wwmayer 7ee0afbf7a Merge pull request #130 from bblacey/develop
Add include of <sstreeam> to fix commit 08692f811 breakage to Ubuntu …
2016-04-03 09:15:29 +02:00
Bruce B. Lacey f2d8daa1fb Add include of <sstreeam> to fix commit 08692f811 breakage to Ubuntu Precise 12.04 builds. 2016-04-02 11:19:28 -07:00
wmayer 7052fde4de + clear selection before hiding the linked object when editing fillet/chamfer 2016-04-02 15:29:08 +02:00
Eivind Kvedalen 484ba25ce6 Spreadsheet: Added test cases. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen a21571a652 Spreadsheet: Removed own expression parser and instead use the one in App. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen c506881614 Expressions: Simpified parser, fixed precedence (parentheses) 2016-04-02 12:01:04 +02:00
Eivind Kvedalen 909727ade8 Expressions: Fixed parsing of unit expressions similar to 1/unit. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen 1626c69494 Expressions: Moved Expression::priority to cpp file. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen b37e6ece98 Expressions: Refactored aggregate functions. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen 08692f811b Expressions: Added support for aggregate functions and ranges. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen 6c80dd4eae Spreadsheet: Fixed crash when invalid unit was given as input. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen e230f3c5e7 Spreadsheet: Expose parse error to user. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen c861505bc9 PropertyPlacement: Convert x, y, z values to Quantities when using them in expressions. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen d6052a5a27 Quantity: Added -= and += operators. 2016-04-02 12:01:04 +02:00
wmayer 0e45008f9a + rework parameter dialog 2016-04-01 15:18:56 +02:00
Yorik van Havre f526ff8f48 Draft: small fix in snaps - issue #2487 2016-03-31 19:33:50 -03:00
wmayer d4ec3a985a + move creation of SoFCSelection node to ViewProviderBuilder to avoid code duplication 2016-03-31 15:54:33 +02:00
wmayer 2521718820 + fix bug in GLImageBox 2016-03-31 14:14:59 +02:00
wmayer 0875dfad34 + remove unneeded namespace 2016-03-31 14:14:22 +02:00
wmayer 031711120d + improve MeshSelection class 2016-03-31 13:35:55 +02:00
wmayer 7dbcbc0f76 + check if OCCGEOMETRY is already defined 2016-03-28 11:05:51 +02:00
Ian Rees 27f12ae3de Find Netgen/nglib on MacOS with MacPorts 2016-03-28 10:48:49 +02:00
wwmayer c69aae4b2f Merge pull request #129 from ianrrees/20160327-use-SystemExitException-code
More fixes around Python exit codes
2016-03-28 10:17:13 +02:00
Yorik van Havre 153e87d36c fixed wrong info in fcinfo tool 2016-03-28 00:27:43 -03:00
wmayer fa77887d09 + fix issue with cursor on viewer widget, prepare code for improved event handling 2016-03-28 00:55:37 +02:00
wmayer d43443a832 + improve GraphicsScene class 2016-03-27 16:22:30 +02:00
wmayer 7993938ab6 + delete transient directory if sub-directory fc_recovery_files is empty 2016-03-27 11:32:29 +02:00
Ian Rees bc71c6e64b More fixes around Python exit codes 2016-03-27 13:01:04 +13:00
wmayer b86e14afff + improve GraphicsScene class 2016-03-26 19:02:15 +01:00
wmayer bd46939070 + make GraphicsView get working again, remove unneeded code 2016-03-26 14:30:36 +01:00
wwmayer 70eeb4b475 Merge pull request #128 from ianrrees/20160326-catch-exceptions-FreeCADCmd
Catch exceptions in FreeCADCmd like FreeCAD
2016-03-26 11:07:31 +01:00
Ian Rees 3cd752417b Catch exceptions in FreeCADCmd like FreeCAD 2016-03-26 20:49:47 +13:00
wmayer 287f3d94ca + resize scene size when resizing graphics view 2016-03-25 18:11:56 +01:00
wmayer 05ed514bcf + replace insecure x/fabs(x) with sgn function 2016-03-24 11:07:30 +01:00
wwmayer 368cd7b731 Merge pull request #125 from triplus/patch-1
Pan support (LMB + RMB) Blender navigation
2016-03-24 09:46:16 +01:00
wmayer 3af29639c6 + various minor fixes, whitespaces improvements 2016-03-23 23:28:56 +01:00
wmayer a69ee20f0c + fix warning of unused variable
+ when clearing scene graph then also empty internal lists
+ whitespace changes
2016-03-22 19:25:38 +01:00
Yorik van Havre 9e75213c92 Document.openTransaction() now accepts unicode 2016-03-22 12:20:58 -03:00
wmayer ff0839184b + make an option to enable C++11 support for clang 2016-03-22 12:29:17 +01:00
wmayer 6453040cd8 + fix mesh merge 2016-03-22 11:06:04 +01:00
wwmayer 9299a73cf1 Merge pull request #126 from bblacey/new-document-icons
Added osx freecad-doc.icns icon resource file.
2016-03-21 19:31:55 +01:00
wmayer 7df94ca9af + fix crash when raising SystemExitException if not called inside Python function 2016-03-21 18:50:57 +01:00
Bruce Lacey feac22b00d FreeCADTest.py invokes sys.exit() instead of the more aggressive os._exit()
With the ability to now pass the <exitCode> from sys.exit() up the
call stack to the shell, FreeCADTest.py should use sys.exit() instead
of the more aggressive os._exit() method that does not allow for
post-exception cleanup.
2016-03-21 18:28:46 +01:00
Bruce Lacey 9816e48b07 Propagate sys.exit(code) up the call stack to the shell
SystemExitException is instantiated and thrown by Base::Interpreter
whenever the python interpreter executes a sys.exit(<exitCode>) call.
However, in the current implementation, the SystemExitException
effectively swallows the <exitCode> hence under this change,
SystemExitException has been extended to save the <exitCode> passed to
the sys.exit() call when it is instantiated and provides a new
getExitCode() accessor method to retrieve the <exitCode> in a
try/catch block.  MainGui.cpp was change to pass the corresponding
<exitCode> to the system exit() call so it is accessible in the shell.
2016-03-21 18:28:29 +01:00
wmayer 5393196c0e + add clean-up function to recovery dialog 2016-03-21 17:56:18 +01:00
Bruce B. Lacey 0f2943bde5 Added osx freecad-doc.icns icon resource file. 2016-03-20 19:51:24 -07:00
Yorik van Havre aa83224594 Merge pull request #124 from bblacey/new-document-icons
Add high-resolution variant of FreeCAD document icon resources for al…
2016-03-20 21:41:33 -03:00
triplus aebcea070c Pan support (LMB + RMB) Blender navigation 2016-03-20 20:24:17 +01:00
Bruce B. Lacey 4ac1e89b65 Add high-resolution variant of FreeCAD document icon resources for all platforms
We did not have document icons defined for OS X and the existing legacy
icons were low resolution.  For this change, we have created a
freecad-doc.svg icon that serves as the basis for generating
platform-specific FreeCAD document icon sets for the supported
platforms.  Extended the OS X bundle definition to include the
high-resolution document icon set and regenerated the existing 64x64
Gui/Icon/freecad-doc.png from the new svg variant.
2016-03-19 19:10:13 -07:00
wmayer c2bf2d0daa + fix build failure on Windows 2016-03-19 21:44:33 +01:00
Yorik van Havre 056c2f1586 Merge pull request #122 from kkoksvik/cmake
Helping cMake find pyside-uic in Arch Linux
2016-03-19 13:22:45 -03:00
wmayer a4dc263846 + always get occ version information in About dialog 2016-03-19 15:55:09 +01:00
wmayer 297e84e3f0 + fix compiler warnings 2016-03-19 10:12:04 +01:00
kkoksvik 3849cd7993 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD into cmake 2016-03-19 08:44:48 +01:00
Bernd Hahnebach eca9e3339a FEM: preference setting to disable restore result dialog settings 2016-03-18 21:53:13 +01:00
Bernd Hahnebach 1280a185c2 FEM: add FIXME comment to CommandQuickAnalysis 2016-03-18 21:53:12 +01:00
Bernd Hahnebach c9d1fbdc7d FEM: fix result stats in result widget for frequency analysis 2016-03-18 21:53:12 +01:00
Yorik van Havre 8829848f35 fixed startpage link 2016-03-18 16:21:33 -03:00
kkoksvik a235cbf275 Helping cMake find pyside-uic in Arch Linux 2016-03-18 11:48:49 +01:00
Yorik van Havre bcb75d5477 Updated translation files from crowdin 2016-03-17 23:29:11 -03:00
Yorik van Havre 2542cb490a Merge pull request #120 from pgilfernandez/FreeCAD_stylesheets204
Dark and Light stylesheets v2.04
2016-03-17 23:17:12 -03:00
Yorik van Havre cf713cf2a1 Merge pull request #121 from wood-galaxy/arch-roof-3
Arch Roof : Fix BOPCheck failed
2016-03-17 20:49:37 -03:00
Jonathan Wiedemann 010121d8c1 Arch Roof : Fix BOPCheck failed
cf http://forum.freecadweb.org/viewtopic.php?f=23&t=14711
2016-03-17 23:24:17 +01:00
wmayer e6f0346521 + make method ManualAlignment::setViewingDirections more reliable 2016-03-17 14:11:03 +01:00
Eivind Kvedalen 9d617ce4c8 Expressions: Changed precedence of ?, :, EQ, NEQ, LT, GT, GTE, and LTE. 2016-03-15 18:28:23 +01:00
Pablo Gil 348303a6cf Stylesheets:
+ selected Tab bar has now opaque background color
+ styles for buttons inside Task Panel that are in reality QToolButtons
+ styles for QListWidget and QTreeView items with checkboxes
+ simplified regular QCheckBox styling
2016-03-15 15:09:28 +01:00
wmayer 6ee243c2fa + pull request 61 2016-03-14 23:07:20 +01:00
wwmayer 711f34f5ae Merge pull request #119 from dev-at-stellardeath-org/python_lib64
Add lib64 to python path
2016-03-14 21:09:56 +01:00
Bernd Hahnebach a0af9e2da0 FEM: unit test, update test result files and expected result files 2016-03-14 20:38:42 +01:00
Bernd Hahnebach eca76c3781 FEM: unit test, add some helper to create result files 2016-03-14 20:38:41 +01:00
Bernd Hahnebach a0a989fe4c FEM: unit test, update FreeCAD file with objects from module TestFem 2016-03-14 20:38:40 +01:00
Bernd Hahnebach 0ffb412aaf FEM: unit test, change load and pressure to some more reasonable values 2016-03-14 20:38:40 +01:00
Bernd Hahnebach 4e407ac4d6 FEM: unit test, remove not used files 2016-03-14 20:38:39 +01:00
wmayer 4f92f5cbbb + fix minor issue with url redirection
+ remove const reference
2016-03-14 18:04:31 +01:00
wmayer fadf2dbc3b + when using QGLFramebufferObject check if a GL context is active 2016-03-14 10:35:13 +01:00
wmayer 18f0cc6346 + issue: #0002440: 0.16 Build rev 6395 Several display issues 2016-03-13 12:56:08 +01:00
Lorenz Hüdepohl 7f355febda Add lib64 to python path
On certain distributions the library directories are called "lib64" on
amd64 machines
2016-03-13 01:18:18 +01:00
wmayer a2b1c3915f + do not hide expression dialog when using the line edit's context-menu 2016-03-12 22:35:36 +01:00
DeepSOIC 5c3024e9f8 Sketcher: negative constraint value avoidance
by swapping elements being constrained at creation time, should the
precalculated value happen to be negative.
2016-03-12 21:28:37 +01:00
DeepSOIC e624a1d00d Sketcher: never ever hide constraint value sign, anymore 2016-03-12 21:28:22 +01:00
wmayer b25ef6235d + on rename of contraint make sure that new name is different, on swap constraint names make sure they have user-defined names 2016-03-12 20:02:18 +01:00
wmayer a17870c93c + fixes #0002471: In constraint context menu, 'Change Value' is always greyed out 2016-03-12 15:26:06 +01:00
wmayer d0e52d3578 + prepare ViewProvider2DObject to read in GridSize from old projects 2016-03-11 23:06:47 +01:00
wmayer f124f6e70b + minor whitespace fix, fix warnings 2016-03-11 21:39:15 +01:00
wmayer 32760491a6 + fixes #0002433: Window weirdness after changing constraint value in sketcher 2016-03-11 13:33:23 +01:00
wmayer 4bccc5cc6e + fixes #0002273: Part: Chamfer edges and fillet edges dialog does not remember the type 2016-03-10 22:04:10 +01:00
wmayer 3f79dfffb6 + allow to get user friendly names for navigation styles 2016-03-10 18:37:48 +01:00
wwmayer 5b156b2380 Merge pull request #115 from pgilfernandez/FreeCAD_stylesheets203
Dark and Light stylesheet 2.03
2016-03-10 12:34:16 +01:00
Pablo Gil 20ee0ba82f Stylesheets:
+ simplified toolbar button separators
+ added hover and pressed states for toolbar buttons to improve user experience
+ partial fix for button with icons inside Task panel
+ fixed styles for fields inside a table cell
2016-03-10 11:58:33 +01:00
wwmayer ed61d65501 Merge pull request #114 from bblacey/set-exitcode-on-unittest-failure
Exit with non-zero status when unit tests fail.
2016-03-10 11:18:21 +01:00
Bruce Lacey 272cbd198d Exit with non-zero status when unit tests fail.
1.  Enhanced TestApp.py to return the unittest TestResult object to the calling method
2.  FreeCADTest.py now checks the TestResult object.  If all tests pass, FreeCADTest.py exits with a 0 however if any tests fail, then it exits with 1.  FreeCADTest.py calls os._exit() with the exit code instead of sys.exit() because Base::Interpreter:SystemExitException intercepts sys.exit() calls and swallows the exit code so there is no way to propogate the non-zero code from the python test cases through the interpreter to the shell in the current call stack.
2016-03-09 21:57:57 -08:00
wmayer 3ca1ec2c28 + issue #0002468: freecad-0.15.4671/src/Base/Handle.cpp:61: bad test ? 2016-03-09 22:13:05 +01:00
wmayer 37b7334df6 + remove extra qualification on normalEstimation 2016-03-09 18:57:36 +01:00
Bernd Hahnebach fcd4603b66 FEM: fix translation issue of FEM Menue 2016-03-09 18:52:22 +01:00
Bernd Hahnebach 1531f5a325 FEM: update FEM example file 2016-03-09 18:52:05 +01:00
wmayer d8430f191f + simplify fix to avoid memory leaks in keySequenceToAccel 2016-03-09 17:19:19 +01:00
wmayer 7ee6214415 + fix unit tests for spreadsheet 2016-03-09 17:03:48 +01:00
wmayer 8a91e7de24 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2016-03-09 15:53:03 +01:00
wmayer 2e43774c2f + terminate xerces at program exit 2016-03-09 15:52:42 +01:00
wmayer 033eb6590e + fix possible build failure 2016-03-09 15:25:15 +01:00
wmayer 6da5c23990 + add algorithm to estimate normals of points 2016-03-09 14:46:19 +01:00
Yorik van Havre 9af03d9b68 Fem: Fixed a translation bug 2016-03-08 21:44:06 -03:00
Yorik van Havre 65f53354c3 Merge pull request #113 from bblacey/mac-osx-packaging
Improved Mac OS X Application Packaging.
2016-03-08 21:39:43 -03:00
Eivind Kvedalen 08044fb737 Spreadsheet: Added code to throw under/overflow exceptions. 2016-03-08 16:09:31 +01:00
Eivind Kvedalen ec7e920453 Spreadsheet: Added test case for conditional expressions. 2016-03-08 16:09:31 +01:00
Eivind Kvedalen e270dee8cc Spreadsheet: Fixed parser so it accepts integer numbers written as e.g 1e3. 2016-03-08 16:09:30 +01:00
Eivind Kvedalen b606ed8ce4 Spreadsheet: Added AtomicPropertyChange object to avoid excessive property change reporting. 2016-03-08 16:09:30 +01:00
Eivind Kvedalen f69a5ab7db Spreadsheet: Turned off debug/tracing for expression parser. 2016-03-08 16:09:29 +01:00
Eivind Kvedalen 8ce2f16759 Expressions: Added code to throw under/overflow exceptions. 2016-03-08 16:09:29 +01:00
Eivind Kvedalen a43e8aafbf Expressions: ints should be 64 bit. 2016-03-08 16:09:28 +01:00
Eivind Kvedalen ac79af0289 Expressions: Use BooleanExpression class for EQ, NE, LT, GT, LTE, and GTE operators. 2016-03-08 16:09:27 +01:00
Eivind Kvedalen 26f4d1ae8e Expressions: Added App::BooleanExpression class. 2016-03-08 16:09:27 +01:00
Eivind Kvedalen 34135e5d2e Expressions: Turned off debug output/tracing for expression parser. 2016-03-08 16:09:26 +01:00
Eivind Kvedalen e940274146 Fixed leak. 2016-03-08 16:09:25 +01:00
Eivind Kvedalen f27fa2ac9b SIM::Coin3D::Quarter::SoQTQuarterAdaptor: Added missing initializationg of member field m_viewingflag. 2016-03-08 16:09:25 +01:00
wmayer 3c1ab4bd9d + extend list of needed pcl components 2016-03-08 15:44:31 +01:00
DeepSOIC 3df9df66d9 Part: JoinFeatures UI improvements
* display originals in tree under the features (like Part Fuse does)
* unhide originals upon delete
* display message box when computing the feature fails on creation
2016-03-08 12:00:19 +01:00
Bruce B. Lacey b18a5f1396 Improved Mac OS X Application Packaging.
1.  Set python dependency paths in Application Bundle adhering the Homebrew convention of installing them in prefix/libexec
   2.  Add appdmg configuration to produce an os x disk image for FreeCAD application distribution
   3.  Added a Tools convenience script to produce an archive name from a serialized Version.h file using the convention FreeCAD_{Major Version Number}.{Minor Version Number}-{Git Revision Count}.{Git Short SHA}-{OS}-{Arch}
2016-03-07 20:49:58 -08:00
wmayer 2879ee24b5 + add missing header 2016-03-08 00:36:17 +01:00
wmayer 4fcb93b64e + issue #0001203: Allow User to Adjust Size of Constraint Points 2016-03-08 00:31:50 +01:00
wmayer 4672066db8 + remove spaces from qss files due to copy problems 2016-03-07 16:54:51 +01:00
wwmayer 9fa224a947 Merge pull request #112 from pgilfernandez/FreeCAD_stylesheets202
Dark and Light stylesheets fixes/improvements
2016-03-07 16:37:33 +01:00
wmayer 1fee124e65 + add CMake file for stylesheet files 2016-03-07 16:08:40 +01:00
wmayer 007a00b7f1 + bug fix similar to idea of pull request 111 2016-03-07 15:12:00 +01:00
Pablo Gil 685bcfb898 Dark and Light stylesheets fixes/improvements:
+ fixed background logo for Win and Linux
+ improved QToolBar handle for different icon sizes (selectable by user inside Preferences)
+ tweaked editable fields inside QToolBar in order to work for all icon sizes (selectable by user inside Preferences)
+ fixed Ubuntu problem that caused a blank line inside up/down buttons of QSpinBox and similar
+ tweaked Python Editor color for Light theme
+ fixed buttons margin/padding inside Task tab
+ tweaked color for checked QPushButtons inside Draft WB for better user experience
2016-03-07 09:50:04 +01:00
Yorik van Havre d1b4f23388 Added latest translations from crowdin 2016-03-06 14:50:07 -03:00
Pablo Gil 8b8db11d9f + Dark and Light stylesheets with 3 color variations each
(from version 2.01, more info: http://forum.freecadweb.org/viewtopic.php?f=9&t=14518)
2016-03-06 13:56:04 +01:00
wmayer 34b9ff8867 + command to create points object from geometry
+ implement TopoShape::getPoints
2016-03-05 23:36:57 +01:00
wmayer 0ec81d2760 + add properties with 'hidden' mode to property editor but hide the item 2016-03-05 18:24:58 +01:00
wmayer 843fbc49fc + set refine option by default 2016-03-05 16:15:45 +01:00
wmayer 781f91e6af + add refine option to shape builder 2016-03-05 16:13:15 +01:00
wmayer 948ccac021 + dynamically hide/show and enable/disable item in property editor 2016-03-05 13:13:23 +01:00
wmayer efdbc93e99 + create points with normals from mesh object 2016-03-04 19:39:13 +01:00
wmayer 70f58672c7 + get also back normals from MeshObject::getPoints 2016-03-04 18:28:49 +01:00
wmayer 0ea6a2ed0d + removed unneeded pure virtual method getFaces from PropertyComplexGeoData
+ extend interface of ComplexGeoData::getPoints to also return normals if available
2016-03-04 17:16:57 +01:00
wmayer 288841cf98 + function to create points from mesh 2016-03-04 16:00:08 +01:00
wmayer a5e6edff87 + support of export of points to pcd and ply format 2016-03-04 14:48:26 +01:00
Bernd Hahnebach 74a43f23b3 FEM: ccxInpWriter, add Nodes dict to self object 2016-03-03 18:40:32 +01:00
fandaL c1bf26bbd7 FEM: ccxInpWriter, copy Nodes dict 2016-03-03 18:40:31 +01:00
wmayer 816b54bd25 + add segmentation algorithm 2016-03-03 18:07:17 +01:00
Yorik van Havre b825dcd6bb Merge pull request #109 from wood-galaxy/bim-ifcproperty-6
Arch : IFC : Handle case where NominalValue is None
2016-03-03 11:12:58 -03:00
Yorik van Havre 513969140d Merge pull request #108 from wood-galaxy/arch-roof-2
Arch : improvements and clean up of roof object
2016-03-03 11:06:07 -03:00
Jonathan Wiedemann 219e212fe0 Merge branch 'master' into bim-ifcproperty-6 2016-03-03 11:07:34 +01:00
Jonathan Wiedemann 2b66257d25 Merge branch 'master' into arch-roof-2 2016-03-03 10:49:33 +01:00
Jonathan Wiedemann d113deab32 Arch Roof : improvement and clean up
change default value
handle shape based object
better getsubvolume method
2016-03-03 10:45:32 +01:00
Bernd Hahnebach 57c783e5b0 FEM: make python modules again flake8 compatible 2016-03-02 22:23:27 +01:00
Bernd Hahnebach bc3cc033e1 FEM: make method names in ccxwriter consisten 2016-03-02 22:23:27 +01:00
Bernd Hahnebach 83ccbbe79d FEM: remove not used methods from FemAnalysis class 2016-03-02 22:23:26 +01:00
wmayer ec992ae1dc + filter out invalid points 2016-03-02 18:04:45 +01:00
wmayer f336b7ed67 + filter out invalid points in surface triangulation algorithms 2016-03-02 16:14:08 +01:00
wmayer 8a76f2c13e + add region growing, segmentation and ransac algorithms to Reen module 2016-03-02 15:51:26 +01:00
Yorik van Havre 1ec066553e Merge pull request #97 from dbtayl/master
Helical/linear ramp plunging
2016-03-01 17:08:19 -03:00
wmayer a1eef54451 + do not allow to set negative grid size in property editor 2016-03-01 18:24:39 +01:00
wmayer 0c5a477fee + fix regression in German translation (also fixed on crowdin) 2016-03-01 16:45:14 +01:00
Yorik van Havre b389554a30 Updated translation tools 2016-03-01 12:34:16 -03:00
Yorik van Havre 7734ffb810 Updated translation files 2016-03-01 12:34:03 -03:00
Jonathan Wiedemann 403ba14f57 Arch Roof : improvement and clean up
change default value
handle shape based object
better getsubvolume method
2016-03-01 09:45:11 +01:00
Jonathan Wiedemann 0172544cc7 Merge branch 'master' into arch-roof-2 2016-03-01 08:08:32 +01:00
Yorik van Havre f1053504a1 Merge pull request #107 from triplus/Set-QComboBox-icon-size
Set QComboBox icon size
2016-03-01 00:13:49 -03:00
wmayer ecd6517cb0 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2016-02-29 23:45:17 +01:00
wmayer 39187dacac + add voxel filter function to Reen module 2016-02-29 23:44:55 +01:00
triplus cf842d569e Set QComboBox icon size 2016-02-29 20:14:49 +01:00
wmayer 2710d276df + fix build failure with gcc 2016-02-29 19:36:22 +01:00
wmayer 9139ab37d3 + change binary export & import of shapes to restore placement and orientation 2016-02-29 18:37:36 +01:00
wmayer 93f32d4dd1 + prepare string for translation 2016-02-29 13:22:49 +01:00
vginkeo f14758d5e5 FEM: C++98 compatible fix to constraint displacement reference deletion, update vertice, edge, face selection 2016-02-29 13:06:16 +01:00
vginkeo e47560003e FEM: do not hide constraints for result view 2016-02-29 13:06:15 +01:00
vginkeo 187894d8b5 FEM: remove some trailing whitespaces 2016-02-29 13:06:14 +01:00
vginkeo fcd2882ad7 FEM: remove module ccxInpWriterFemConstraintDisplacement
which was intoduced in commit b1dc2cb by an accident
2016-02-29 13:06:13 +01:00
wmayer 5574419293 + set range for quantity boxes 2016-02-29 12:29:02 +01:00
Yorik van Havre bcd0ec8f53 Merge pull request #106 from bblacey/update-osx-0.16-iconset
Added High Resolution Display icons to Mac OS X iconset resource file…
2016-02-28 23:00:32 -03:00
Yorik van Havre 6f636e0ae9 Start: Updated startpage - fixed some links + restored commits feed 2016-02-28 22:03:03 -03:00
Bruce Lacey ee8ac77eab Added High Resolution Display icons to Mac OS X iconset resource file (.icns). 2016-02-28 14:39:31 -08:00
Yorik van Havre 5bdbe2db61 Draft: better docstring for offset - fixes #2199 2016-02-28 19:28:35 -03:00
wmayer a59b915132 + code clean-up 2016-02-28 19:01:23 +01:00
wmayer 4e29db90c6 + fixes #0002200: Application crash when modifying fillet 2016-02-28 18:56:21 +01:00
Yorik van Havre 9bd89e7e29 Arch: Fixed bug in extrusion of structures - fixes #2458 2016-02-28 14:03:29 -03:00
wmayer 9e01a08eaf + use quantity boxes in mesh segmentation dialog 2016-02-28 12:48:55 +01:00
wmayer 1fd06ef59b + use quantity boxes in mesh solid creation dialog 2016-02-28 12:44:29 +01:00
wmayer 32a5340b0b + use application-wide number of decimals in primitive creation dialog 2016-02-28 12:30:42 +01:00
wmayer 3f15ae80d0 + fixes #0002049: 0.15 and 0.16 Part Revolve ignores unit accuracy setting beyond 2 decimals 2016-02-28 12:12:10 +01:00
wmayer dd3d30a4da + use quantity boxes in location widget 2016-02-28 12:11:24 +01:00
wmayer d9e47e5896 + make fillet/chamfer dialog narrower 2016-02-28 11:39:32 +01:00
wmayer 92c2b18350 + use quantity boxes in fillet/chamfer dialog 2016-02-28 11:24:36 +01:00
Yorik van Havre e3aba10762 Merge pull request #104 from ianrrees/20160228-fix-mac-builds
Resolve clang compile error
2016-02-27 19:16:43 -03:00
Ian Rees d811b585b7 Resolve clang compile error 2016-02-28 10:33:55 +13:00
wmayer e1e0777c7b + add quantity boxes to mirroring dialog 2016-02-27 22:10:28 +01:00
wmayer 236f1666db + use quantity boxes in box & cylinder creation dialogs 2016-02-27 21:39:37 +01:00
wmayer d56357f764 + use quantity boxes in revolution dialog 2016-02-27 21:31:54 +01:00
Yorik van Havre 67257633d6 Merge pull request #102 from triplus/SVG_WB_Icons
Add SVG workbench icons
2016-02-27 16:06:13 -03:00
Yorik van Havre 26639f1eca Updated Mac icon with the new style 2016-02-27 15:49:36 -03:00
wmayer 206e183f52 + use quantity box in offset dialog 2016-02-27 19:43:48 +01:00
wmayer da9656dd7a + use quantity boxes in cross section dialog 2016-02-27 19:25:19 +01:00
wmayer f868120a77 + use quantity boxes in inspection dialog 2016-02-27 19:07:29 +01:00
wmayer 3fc7b6bfb2 + use quantity box for length on extrusion dialog 2016-02-27 18:37:53 +01:00
Yorik van Havre 6fe6863001 Draft: Fixed placement bug in clones 2016-02-27 13:30:01 -03:00
Yorik van Havre 0c5484335d Merge pull request #103 from triplus/RadiosityOutdoorHQ
Add RadiosityOutdoorHQ.pov Raytracing Template
2016-02-27 13:17:13 -03:00
wmayer ede0dbdff7 + use quantity box in DlgSettingsImportExport 2016-02-27 17:16:38 +01:00
wmayer d8abb92ba5 + add convenience methods to PrefQuantitySpinBox class 2016-02-27 17:03:14 +01:00
wmayer 37e9c9732f + use quantity box in tessellation dialog 2016-02-27 16:02:37 +01:00
wmayer 18a61c0ef8 + use quantity box in image orientation dialog 2016-02-27 15:10:31 +01:00
wmayer 202a1be3f5 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2016-02-27 15:07:59 +01:00
wmayer 461bc33fbf + fix typo in Raytracing dialog 2016-02-27 15:07:16 +01:00
triplus dabcf32e6b Added RadiosityOutdoorHQ.pov 2016-02-27 03:13:27 +01:00
triplus e53e0ab0f5 Added RadiosityOutdoorHQ.pov 2016-02-27 03:11:45 +01:00
triplus f66998e996 Create RadiosityOutdoorHQ.pov 2016-02-27 03:10:01 +01:00
triplus d432c72a15 Add SVG workbench icons 2016-02-26 23:17:43 +01:00
Yorik van Havre 28b6c82555 Added updated translations from crowdin - fixes #2443 2016-02-26 18:32:02 -03:00
Yorik van Havre d3870968df Draft: Fixed undo mode of wires - fixes #2456 2016-02-26 16:11:13 -03:00
Yorik van Havre 83f87ba3ea Turned Zoom At Cursor option True by default - fixes #2371 2016-02-26 13:51:39 -03:00
Yorik van Havre 7675a8effa Made Redirect python output options True by default - fixes #2454 2016-02-26 13:43:51 -03:00
Yorik van Havre a1f16cabec Merge pull request #101 from wood-galaxy/sketcher-micro-sizing
Sketcher : Allow µm in sketcher grid size
2016-02-25 12:00:01 -03:00
Jonathan Wiedemann a7e05382ad Merge branch 'master' into bim-ifcproperty-6 2016-02-25 11:24:27 +01:00
Jonathan Wiedemann 604fc320cf Arch - IFC : Handle case where NominalValue is None 2016-02-25 11:23:10 +01:00
maurerpe 3f3d8a95f5 Fix remaining toAscii/fromAscii
Qt5 does not have toAscii or fromAscii.  Use toLatin1 and fromLatin1
respectively.  Both replacement functions exist in Qt4.8.
2016-02-24 23:56:43 +01:00
maurerpe e1f3fe1be4 Change numBytes() to byteCount()
numBytes() is obsolete in Qt 4.8 and removed in Qt5.  byteCount() is a
drop in replacement that works in 4.8 and 5.
2016-02-24 23:56:25 +01:00
maurerpe 31fd2d1762 Ensure mutexes are always properly unlocked
Error exists with Qt4 and Qt5.  Qt5 generated helpful warnings that made
it easier to debug.
2016-02-24 23:56:05 +01:00
maurerpe 8de9436c36 Add missing header files
Needed for Qt5, recommended for Qt4
2016-02-24 23:55:40 +01:00
wmayer 52fac57d73 + fix bug in MDIView 2016-02-24 21:32:30 +01:00
wmayer 63e09bcbc2 + add convenience methods to query/alter selection of mesh object 2016-02-24 21:31:12 +01:00
wmayer 660a30ce01 + fix some weirdness in Application class 2016-02-24 21:04:47 +01:00
wmayer e6624bf1c3 + add method to get display mask mode from view provider 2016-02-24 21:00:55 +01:00
wmayer d891ddba33 + fix a memory leak in mesh selection 2016-02-24 21:00:26 +01:00
wmayer 35fa65ec96 + fix possible crash in parameter editor 2016-02-24 20:59:04 +01:00
wmayer 5342b67122 + when cutting scattered points then also remove colors, grey values or normals if available 2016-02-23 19:47:54 +01:00
Yorik van Havre c8d8df59b1 Updated the FreeCAD icon to the new style 2016-02-23 11:45:37 -03:00
wmayer f4b288fcf8 + fix to get gridline-color of stylesheet in property editor 2016-02-23 13:05:48 +01:00
wmayer 869e7870f5 + in pad dialog make sure not to compare quantities with different units 2016-02-23 11:34:04 +01:00
Yorik van Havre 9e551e0fdb Merge pull request #95 from wood-galaxy/bim-ifcproperty5
Arch BIM IFC : Add IFC Properties spreadsheet container
2016-02-22 20:35:28 -03:00
Yorik van Havre c6af697230 Draft: avoid blocking keys in fields that can be used for units 2016-02-22 20:16:51 -03:00
Daniel Taylor e5f1f4df3d Basic helical plunge and linear-ramp plunging 2016-02-21 09:45:29 -06:00
Daniel Taylor 377595647d Fixed "prnt" function to properly limit to 4 decimal places
Greatly simplify rebaseWire
2016-02-21 09:45:29 -06:00
wmayer a3209e1aee + do some code cleanup and renaming in Points module 2016-02-21 16:18:28 +01:00
wmayer 24e4e08be5 + view provider for scattered and organized point clouds 2016-02-21 13:52:17 +01:00
wmayer 7bdecf9b38 + handling of organized point cloud 2016-02-20 22:19:47 +01:00
wmayer 60e0c447ca + make PropertyEditor class ready to be customized with Qt style sheet 2016-02-20 16:00:35 +01:00
Jonathan Wiedemann 6b7190d3f0 Arch BIM IFC : Add IFC Properties spreadsheet container 2016-02-20 13:25:26 +01:00
Yorik van Havre 4928624d14 Arch: Small workaround in IFC importer 2016-02-19 18:08:12 -02:00
Jonathan Wiedemann f16a26662d Sketcher : Allow µm in sketcher grid size 2016-02-19 16:32:25 +01:00
Jonathan Wiedemann e37cdf15cf Arch Change default value
Comment some print
2016-02-19 16:20:57 +01:00
Yorik van Havre 577f208da7 Revert "FEM: Updated fix to constraint displacement reference deletion, update hide show, remove custom input writer, update vertice, edge, face selection."
This reverts commit ac4d466443.
2016-02-19 00:05:55 -02:00
Yorik van Havre fa6046ea19 Draft: fixes in line/wire creation by angle 2016-02-18 20:09:19 -02:00
vginkeo ac4d466443 FEM: Updated fix to constraint displacement reference deletion, update hide show, remove custom input writer, update vertice, edge, face selection. 2016-02-18 19:15:16 -02:00
Eivind Kvedalen 2dca1ffc39 PropertyExpressionEngine: Fixed warning. 2016-02-18 16:54:45 +01:00
Eivind Kvedalen 1da5d33996 Expression class: Improved error message when resolving a variable fails. 2016-02-18 16:54:44 +01:00
Eivind Kvedalen be671259cb PropertExpressionEngine: Ignore dependencies that does not resolve to a document when verifying expressions. 2016-02-18 16:54:44 +01:00
Eivind Kvedalen 727a06689a PropertyExpressionEngine: Fixed bug in Copy and Paste (make deep copies of the expressions). 2016-02-18 16:54:43 +01:00
Eivind Kvedalen 9606fb144a Spreadsheet: Updated test cases. 2016-02-18 16:54:43 +01:00
Eivind Kvedalen b74b3f3358 Spreadsheet: Refactor code and reuse visitors from ExpressionVisitors.h 2016-02-18 16:54:42 +01:00
Eivind Kvedalen 1802d94a1a Spreadsheet: Override DocumentObject::renameObjectIdentifiers() to get better renaming support. 2016-02-18 16:54:42 +01:00
Eivind Kvedalen 810135fad4 PropertyExpressionEngine: Refactored and moved visitor code to separate file. 2016-02-18 16:54:41 +01:00
Eivind Kvedalen 095c823fda Expression: Added ExpressionModifier class, used as base class for visitors that may modify its expressions. 2016-02-18 16:54:41 +01:00
Eivind Kvedalen 8c943d0ad7 Spreadsheet: Refactored code to use AtomicPropertyChangeInterface. 2016-02-18 16:54:40 +01:00
Eivind Kvedalen 53dcaccd4e Spreadsheet: Refactored alias checking code, so GUI and Python error messages are aligned. 2016-02-18 16:54:39 +01:00
Eivind Kvedalen e5f1e298a6 ObjectIdentifier: Reworked resolve() function to solve issue #2389 and #2418.
* Refactored code; moved mutable fields into a separate inner class.
* Added resolvedProperty to ResolveResults class.
* Set resolved document name, even if it does not resolve correctly, so we can give a better error message later.
* If the document name is explicitly set, and it does not resolve, don't try any further.
* If document name is set, use that instead of the ObjectIdentifier's owner when looking up the document object.
2016-02-18 16:54:39 +01:00
Bernd Hahnebach 183f8dfebe FEM: fix unit test cases 2016-02-17 19:36:16 +01:00
Bernd Hahnebach 2f2e6e8f8c FEM: infile fix, youngs modulus and poisons ratio
have to be in one line for ccx 2.9
2016-02-17 19:36:16 +01:00
wwmayer 69c241ba89 Merge pull request #94 from f3nix/qt5-compatibility-1
Qt5 compatibility changes.
2016-02-16 10:01:45 +01:00
wmayer 167b78ed8e + fix Debian bug #811200 2016-02-15 23:01:40 +01:00
wmayer 1a64c3f2dc + fixes #0001592: Import colored PCL point clouds 2016-02-14 22:46:27 +01:00
Yorik van Havre 237c74c212 Updated offline pdf generation tool 2016-02-14 19:28:32 -02:00
Mateusz Skowroński 4ef8c9707f Qt5 compatibility changes.
QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
QChar::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().

This change is Qt4/Qt5 neutral.
2016-02-14 08:23:00 +01:00
Yorik van Havre d2fead0f2a Updated offline documentation 2016-02-13 20:37:11 -02:00
Yorik van Havre 4d782e42ed updated offline doc tools to handle the Command_Reference pages 2016-02-13 20:36:28 -02:00
wmayer fbd6f9002c + fix to load mesh with colours 2016-02-13 20:01:47 +01:00
Yorik van Havre 0e897b86c0 Merge pull request #93 from ianrrees/20160213-fix-non-gui-build
Add cmake checks for BUILD_GUI to some modules
2016-02-13 14:37:58 -02:00
wmayer 408d7a9ba8 + translation fixes 2016-02-13 16:48:24 +01:00
Ian Rees e242e4643b Add cmake checks for BUILD_GUI to some modules 2016-02-13 13:45:27 +13:00
Yorik van Havre 66e719f3f5 Allow to use an encoded doc string in FeaturePython::addProperty 2016-02-12 20:47:11 -02:00
Yorik van Havre d0bc467e6a Path: Fixed some more translation contexts 2016-02-12 20:29:28 -02:00
Yorik van Havre a649c3ca31 Arch: Fixed window bug - fixes 2449 2016-02-12 20:19:59 -02:00
Yorik van Havre 6a35ef38c7 Updated ts files 2016-02-12 14:22:04 -02:00
vginkeo b1dc2cbf94 FEM: Implement constraint displacement in C++ 2016-02-12 11:09:58 +02:00
Yorik van Havre 6a103493a1 Arch: small fix in IFCexport 2016-02-11 20:06:06 -02:00
Yorik van Havre fe22e9730f Updated version number in offline doc tools and removed unnecessary file 2016-02-11 19:57:43 -02:00
Yorik van Havre 5388520a20 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2016-02-11 14:57:11 -02:00
Yorik van Havre ce8ed2ade3 Path: Enabling highlight/selection colors in paths 2016-02-11 14:55:37 -02:00
Yorik van Havre 833c4aa860 Merge pull request #91 from wood-galaxy/bim-ifcproperty4
Arch BIM IFC : Handle utf8 for IfcDescriptiveMeasure
2016-02-11 14:22:16 -02:00
Jonathan Wiedemann 5c5e62ffbd Arch BIM IFC : Handle utf8 for IfcDescriptiveMeasure 2016-02-11 15:49:58 +01:00
Ian Rees 01032c952d Don't use -std=c++0x for gcc <4.7 2016-02-11 17:59:44 +13:00
Yorik van Havre f942bf2729 Arch: Enabled IFC4 export and fixed a couple of bugs 2016-02-10 15:35:21 -02:00
Yorik van Havre 381dcfe7e3 Draft: Fixed problem with addPoint and delPoint buttons 2016-02-10 15:34:54 -02:00
wmayer 33344be035 + support of colors per vertex in obj mesh format 2016-02-10 15:09:04 +01:00
Yorik van Havre 45f059d3a9 Draft: replaced the Draft OK task button with a more clear 'Create Point' button. 2016-02-09 17:58:22 -02:00
Yorik van Havre 7ff4e28599 Path: Fixed translation stuff - issue #2443 2016-02-09 17:05:57 -02:00
Yorik van Havre 0e8974a370 Made PropertyFloatList accept ints too - fixes #2444 2016-02-09 16:01:10 -02:00
Yorik van Havre 42c42fd064 Draft: removed redundant transactions in Draft edit mode 2016-02-09 13:11:46 -02:00
wmayer beb52c4e65 + replace old C cast with static_cast 2016-02-09 16:02:44 +01:00
wmayer 02578c4e6b + suppress warnings when copying an object 2016-02-09 16:01:23 +01:00
wmayer fe8be472a9 + fix unit tests 2016-02-09 16:00:38 +01:00
wmayer bb6a66bd82 + fix minor regression of issue 2417 2016-02-08 11:04:50 +01:00
wmayer 6763d3a6e4 + add Puthon binding to AbstractSplitView 2016-02-06 18:54:40 +01:00
wmayer c30031f3d2 + fix possible problems with roundoff errors of SbRotation 2016-02-06 18:51:22 +01:00
Yorik van Havre 1324575b35 Arch: Fixed missing views of windows 2016-02-05 19:05:15 -02:00
Yorik van Havre 32b6d4af9c Added draft & arch tests to the Test GUI 2016-02-05 16:47:36 -02:00
Yorik van Havre dea9127ac2 Create the macro path if inexistant when saving a macro 2016-02-05 16:40:53 -02:00
Yorik van Havre 0be4c51440 Merge pull request #88 from ianrrees/20160204-boost-min-version-1_55
Minimum Boost version to 1.55 except for gcc < 4.7
2016-02-05 14:24:20 -02:00
Yorik van Havre d4d9b7aee1 Arch: small fix in window placements 2016-02-05 13:09:40 -02:00
Yorik van Havre 1867c0d276 Merge pull request #89 from wood-galaxy/bim-ifcproperty3
Arch - BIM - Add IFC Spreadsheet properties system
2016-02-04 23:29:55 -02:00
Jonathan Wiedemann df3648a864 Arch - little IFC Spreadsheet adjustement 2016-02-05 02:08:23 +01:00
Jonathan Wiedemann 980b8dbeda Arch - Fix #2430 - Add IFC Spreadsheet properties system 2016-02-04 20:55:45 +01:00
Yorik van Havre ba9e43abc4 Arch: simplifications of Window tool
* If an arch object is selected when creating a window, the window is always inserted in that object
* No more "create from scratch" mode.
* Now needs to create the sketch first, then press the window button
* Added "Auto-include" checkbox in window creation task, to disable auto-embedding
* Fixed wrong orientation of windows
2016-02-04 13:55:39 -02:00
Ian Rees 6ae327d1f7 Minimum Boost version to 1.55 except for gcc < 4.7 2016-02-04 18:55:59 +13:00
Yorik van Havre 2e2192f88a Added slovenian language 2016-02-03 13:36:51 -02:00
Yorik van Havre 88be837f72 Arch: fixed bugs in IFC importer 2016-02-03 13:01:34 -02:00
Yorik van Havre f3d66aa674 OpenSCAD: allow to enable verbose output in preferences 2016-02-03 12:04:48 -02:00
Yorik van Havre 35cc2879e5 Arch: fixed wrong syntax in IFC importer 2016-02-03 10:50:19 -02:00
Yorik van Havre ab89c9af94 Draft: redraw wire arrow on file load - fixes #2424 2016-02-02 19:26:34 -02:00
Yorik van Havre 79a615f222 DXF and IFC pref pages can now be set to show on each import/export 2016-02-02 16:13:40 -02:00
Yorik van Havre 5ef5a8ec3c Gui: added Gui.showPreferences() python function
This function accepts 2 optional arguments: a string (ex. "Draft")
and an integer (ex. 2). If given, the preferences dialog will open at
the third tab of the Draft group, if existing.
2016-02-02 15:01:42 -02:00
Yorik van Havre 388ea0629c OpenSCAD: set legacy options when using importDXF 2016-02-02 14:19:40 -02:00
Bernd Hahnebach e214567a64 Start: add FEM example to Start page 2016-02-02 07:18:48 +01:00
Bernd Hahnebach b0ba55316b FEM: add FCStd file to FreeCADs example files 2016-02-02 07:18:48 +01:00
Bernd Hahnebach b3f77dcc35 FEM: material task panel, save density in kg per m3 to material dictionay 2016-02-02 07:18:48 +01:00
Bernd Hahnebach e9606a241a FEM: fix, transient material was used in some cases even if material was not changed 2016-02-02 07:18:47 +01:00
Bernd Hahnebach efc9b712ae FEM: small changes in CalculiX standard steel material 2016-02-02 07:18:47 +01:00
Bernd Hahnebach 3690313065 FEM: use transient material for a saved None material too
this will reload material data saved into the None material
2016-02-02 07:18:46 +01:00
Bernd Hahnebach 60cdca01a8 FEM: fix, use uniqe names for materials in CalculiX input file 2016-02-02 07:18:46 +01:00
Yorik van Havre 37b1bdbe27 Updated translations with latest from crowdin 2016-02-01 23:32:58 -02:00
Yorik van Havre fc9fe3ee00 Draft: fixed bug introduced by OK button 2016-02-01 20:28:30 -02:00
Yorik van Havre 04e9392e37 Draft: added a note to DXF options 2016-02-01 19:47:50 -02:00
Yorik van Havre 2688a2f501 Material: Fixed return value of the material editor 2016-02-01 19:35:48 -02:00
Yorik van Havre 704d3caf08 Draft: small bugfix in wires 2016-02-01 17:56:20 -02:00
Yorik van Havre c25595266b Fixed non dereferenced py pointer in ParameterPy 2016-02-01 13:34:37 -02:00
Yorik van Havre fdcd605498 Merge remote-tracking branch 'ovginkel/rtd_arrowssinglecommit' 2016-02-01 12:44:14 -02:00
Yorik van Havre fe959b8986 Draft: bugfix in legacy DXF importer 2016-02-01 12:15:50 -02:00
vginkeo 80a791021b FEM: Constraint view sizing and scaling of indicators for force, pressure and fixed constraints and limit on steps. 2016-02-01 10:52:37 +02:00
Yorik van Havre 4cb5de6848 Arch: fixed OBJ import without GUI - fixes #2305 2016-01-31 16:53:54 -02:00
Yorik van Havre 87da750d56 Draft: fixed bug in task panels 2016-01-31 16:28:13 -02:00
wwmayer d1a02e8d35 Merge pull request #83 from ianrrees/20160126-c++11
Turns on C++11 support for GCC and Clang
2016-01-31 15:27:32 +01:00
wmayer a3bf5421fe + fixes #0002417: console autocomplete runs python properties 2016-01-31 13:54:18 +01:00
wmayer 6117c31bcc + unify error messages on not found libraries 2016-01-31 09:41:41 +01:00
wmayer 0f858f99b7 + issue #0002417: console autocomplete runs python properties 2016-01-31 02:28:24 +01:00
Yorik van Havre 2cb06c6f65 Fixed wrong value returned by ParameterPy::GetUnsigned 2016-01-30 17:24:28 -02:00
Yorik van Havre 15a4976c97 Draft: implemented OK button in task dialogs - fixes #2423 2016-01-30 15:07:29 -02:00
Yorik van Havre 287e741210 Draft: Added Tick style for dimensions and wire/line arrows - fixes #2425 2016-01-30 14:46:38 -02:00
Yorik van Havre d45abca952 Draft: fixed end arrow of lines/wires - fixes #2424 2016-01-30 14:31:32 -02:00
Ian Rees 8219102dbe Turn on C++11 support for GCC and Clang 2016-01-30 21:29:31 +13:00
Yorik van Havre 645a83ad32 Arch: New behaviour against circular dependency can now be switched off in preferences 2016-01-29 12:29:03 -02:00
Yorik van Havre 3702820f00 Arch: Added an IFC pref option to disable clones creation on import 2016-01-29 00:28:47 -02:00
Yorik van Havre 5fbdd4ac66 Arch: bugfix in Structure creation 2016-01-28 13:53:58 -02:00
Yorik van Havre 5ec2ea0e6c Merge pull request #84 from sanguinariojoe/master
Matplotlib navigation toolbar support
2016-01-28 13:06:38 -02:00
Jose Luis Cercos Pita feb9b58a7e Added the matplotlib navigation toolbar, and methods to toogle it on/off 2016-01-28 10:25:53 +01:00
Jose Luis Cercos Pita f07f047bbf Fixed deprecation warning when matplotlib 1.4 is used 2016-01-28 10:24:35 +01:00
Yorik van Havre 2eb194776b Merge pull request #82 from bblacey/matplotlib-1.5
Upgraded Plot module to comply with matplotlib 1.5.x API
2016-01-27 21:55:02 -02:00
Yorik van Havre 23cc9ba32e Path: small fix in arcs rendering 2016-01-27 19:27:24 -02:00
wmayer 173f19eff4 + move handwritten Python classes to PyCXX 2016-01-27 18:07:48 +01:00
wmayer dec030b34e + base ParameterGrpPy class on PyCXX and fix usage of unsigned values 2016-01-27 18:05:56 +01:00
Yorik van Havre 1a06e50f0e Merge pull request #81 from ianrrees/20160126-mac-relocate-script-warnings
Added notes + warnings to mac app bundle tool.
2016-01-27 13:05:32 -02:00
Bruce Lacey 9f907f5d1b Upgraded Plot module to comply with matplotlib 1.5.x API
Plot.py will check the version of matplotlib imported using the
distutils.version.StrictVersion class.  If the version is less
than 1.5.0, it will import the legacy gt4agg NavigationToolbar
from matplotlib, otherwise the 1.5.x version.

Resolves #2421
2016-01-26 22:31:29 -08:00
Ian Rees 641a3abc0a Added notes + warnings to mac app bundle tool. 2016-01-27 18:07:08 +13:00
wmayer c6740162bc + cleanup spreadsheet tests and corrected date & author 2016-01-26 21:33:31 +01:00
wmayer 1b8cd9b91c Revert "ObjectIdentifier: Issue #2389: Needs to set documentNameSet and documentObjectNameSet to true to resolve properly."
This reverts commit 670eaf04a6.
2016-01-26 20:58:28 +01:00
wmayer d7dd512428 + small fixes in spreadsheet tests 2016-01-26 15:29:39 +01:00
wmayer e0b12695b1 + write unit tests for Spreadsheet and expression stuff 2016-01-26 15:07:29 +01:00
wmayer 28b92c478b + raise a TypeError instead of a standard exception in ObjectIdentifier 2016-01-26 12:49:15 +01:00
wmayer 72328ed0a1 + avoid throwing exceptions in property editor if not needed 2016-01-26 12:48:15 +01:00
Ed Martin d71a12db05 Spreadsheet: Issue #2355: Do not recompute the spreadsheet and its dependents unless the change affects the spreadsheet 2016-01-26 12:04:55 +01:00
Eivind Kvedalen 670eaf04a6 ObjectIdentifier: Issue #2389: Needs to set documentNameSet and documentObjectNameSet to true to resolve properly. 2016-01-26 11:58:12 +01:00
Eivind Kvedalen 22d77b784a VariableExpression: Add converters for long and bool data types. 2016-01-26 11:49:50 +01:00
Eivind Kvedalen e9480e6a09 ObjectIdentifier: Issue #2407: Fixed resolution of DocumentObject, to differentiate better between internal name and Label. 2016-01-26 11:25:58 +01:00
Eivind Kvedalen ed29d8ef9a Spreadsheet: Fixed crash when removing aliases. 2016-01-26 11:14:06 +01:00
Eivind Kvedalen bcff5d21ca Spreadsheet GUI: Issue #2402: Check for existing aliases in Properties dialog box. 2016-01-26 11:07:51 +01:00
Eivind Kvedalen e8eef1dfcb Spreadsheet: Issue #2402: Added getAlias function. 2016-01-26 10:53:26 +01:00
Eivind Kvedalen 610466284b Spreadsheet: Issue #2402: Allow set to also accept alias name (in addition to cell address). 2016-01-26 10:53:03 +01:00
Eivind Kvedalen 301fcc2ab7 Spreadsheet: Issue #2402: Don't allow duplicate aliases. 2016-01-26 10:52:34 +01:00
Eivind Kvedalen d45a95bf3a Spreadsheet: Issue #2402: Added functionality to get cell address given an alias. 2016-01-26 10:52:00 +01:00
wmayer a583697e5a + fix CMakeLists.txt file of Ship module 2016-01-25 21:46:01 +01:00
wmayer abcb12caec + fix error message in PropertyFileIncluded::setPyObject 2016-01-25 21:45:14 +01:00
wwmayer 173d197fe0 Merge pull request #80 from sanguinariojoe/master
FreeCAD Ship
2016-01-25 21:33:32 +01:00
Jose Luis Cercos Pita d6ca807b71 Updated the windows installer 2016-01-25 15:38:23 +01:00
Jose Luis Cercos Pita 621f7f49e0 Fixed index typo 2016-01-25 15:29:53 +01:00
Jose Luis Cercos Pita ec752fd076 Merge remote-tracking branch 'upstream/master' 2016-01-25 15:26:18 +01:00
Jose Luis Cercos Pita 499c685668 Added the GZ curves computation tool to the console interface 2016-01-25 15:15:04 +01:00
Jose Luis Cercos Pita f0770a7456 Added the loading conditions creation to the console interface 2016-01-25 09:11:19 +01:00
Jose Luis Cercos Pita 83d5217795 Added the capacity curve computation tool to the console interface 2016-01-25 08:50:57 +01:00
Yorik van Havre cbdd18cef6 Path: Added pref setting to disable auto-include of new paths in projects 2016-01-24 21:04:02 -02:00
wmayer a691fec1dd + fix exception text in PropertyFileIncluded 2016-01-24 21:06:02 +01:00
wmayer 57fadb1663 + handle crash with setup of Join commands in Part module in case PySide can't be found 2016-01-23 23:37:52 +01:00
Yorik van Havre 380b4a7b62 Path: Fixed non-functioning Path From Shape 2016-01-23 19:39:34 -02:00
Yorik van Havre baf103ad0a Path: Added Simple Copy tool + Inspect tool can now save changes 2016-01-23 15:58:00 -02:00
Yorik van Havre 4c3782ff96 Merge pull request #79 from ianrrees/20160123-3dconnexion-mac-bundle
Fixes issue with Mac bundles and 3Dconnexion drivers
2016-01-23 13:32:02 -02:00
Jose Luis Cercos Pita c3ccd0f72c Added a console interface to the tanks generation 2016-01-23 14:35:56 +01:00
Jose Luis Cercos Pita a615380027 Added a console interface to the weights generation 2016-01-23 14:21:25 +01:00
Ian Rees b5688aade5 Tidy logging (+whitespace) in Mac 3Dconnexion 2016-01-23 19:23:11 +13:00
Ian Rees ada6ad5d89 Add /Library/Frameworks/ to known system libraries
Fixes issue where the 3Dconnexion drivers weren't found in relocateable
mac application bundles.
2016-01-23 19:23:11 +13:00
Ian Rees 45d343e975 Prevent adding duplicate rpaths to bundled libs 2016-01-23 19:23:11 +13:00
wmayer 27fbccaeab + rename method 'transform' to 'tramsformGeometry' for the classes PropertyNormalList and PropertyCurvatureList
+ make transformGeometry method ready for undo/redo
2016-01-22 13:18:24 +01:00
Jose Luis Cercos Pita 0a4a8191a2 Added all the Hydrostatics to the console interface 2016-01-22 13:17:13 +01:00
Yorik van Havre 7bba2ee9aa Path: better colors for PAth Inspector 2016-01-21 18:07:47 -02:00
Jose Luis Cercos Pita c65dbe1db1 Implemented a generic method to move the ship shape in order to compute the hydrostatics 2016-01-21 20:14:57 +01:00
Jose Luis Cercos Pita e1aa844e95 Added the possibility of computing the transversal areas from the console interface 2016-01-21 19:57:55 +01:00
Jose Luis Cercos Pita 55c63f414d Corrected the translation environment 2016-01-21 19:26:47 +01:00
Jose Luis Cercos Pita 94cc4b4e36 Updated the copyright notifications 2016-01-21 18:56:28 +01:00
Jose Luis Cercos Pita 495308905c Added a console interface to create the ship instance 2016-01-21 18:46:08 +01:00
Yorik van Havre 2ed8e5dd99 Path: misc bugfixes + restored node markers 2016-01-21 14:02:56 -02:00
wmayer 5033983c64 + code clean-up 2016-01-21 16:43:27 +01:00
wmayer f47cc169ae + make code more readable 2016-01-21 16:07:07 +01:00
wmayer c9f168d3a2 + simplify porting of Mesh module to Python3 2016-01-21 15:49:22 +01:00
wmayer aa7aa64724 + simplify porting of Drawing module to Python3 2016-01-21 14:49:57 +01:00
wmayer bf10bf33f6 + simplify porting of Fem module to Python3 2016-01-21 13:42:08 +01:00
wmayer 094a4352f1 + simplify porting of Complete module to Python3 2016-01-21 12:38:17 +01:00
wmayer 85d8d70411 + simplify porting of Image module to Python3 2016-01-21 12:27:12 +01:00
wmayer a5b6e5d48a + simplify porting of Import module to Python3 2016-01-21 12:08:29 +01:00
Yorik van Havre 44ad4d94c7 Path: made tooltable editable by right-clicking the machine 2016-01-20 20:36:53 -02:00
wmayer a07b9cd0d4 + simplify porting of Inspection module to Python3 2016-01-20 22:48:26 +01:00
wmayer b5bf7d6b9d + simplify porting of MeshPart module to Python3 2016-01-20 22:38:45 +01:00
wmayer 3185e09806 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2016-01-20 22:06:20 +01:00
wmayer b10f838687 + simplify porting of Part module to Python3 2016-01-20 22:05:53 +01:00
Yorik van Havre ba63d7af11 Path: reorganized tools 2016-01-20 19:05:12 -02:00
Yorik van Havre 08dda60d00 Path: ToolChange command + added Inspect command to context menu 2016-01-20 18:53:04 -02:00
Yorik van Havre 2262e7d60f Path: minor improvements to some icons 2016-01-20 17:44:19 -02:00
wmayer 91d6e24f1e + simplify porting of PartDesign module to Python3 2016-01-20 17:00:43 +01:00
Jose Luis Cercos Pita 9770cca561 Finished the GZ curve implementation 2016-01-20 15:13:00 +01:00
Jose Luis Cercos Pita 6315084f58 Slightly improved the capacity curve plot 2016-01-20 12:36:05 +01:00
Jose Luis Cercos Pita d8e511f1dc Moved to a more robust Part module based boolean common operator 2016-01-20 12:35:47 +01:00
wmayer ebc6d37262 + simplify porting of DraftUtils module to Python3 2016-01-20 11:57:59 +01:00
Jose Luis Cercos Pita 2814565850 Cleared out some debug messages 2016-01-20 11:52:36 +01:00
Jose Luis Cercos Pita 65df5010f8 Fixed a typo in the transformation angles 2016-01-20 11:51:59 +01:00
wmayer cbe9c39a96 + fix typo 2016-01-20 11:22:27 +01:00
wmayer f85d168ef0 + simplify porting of Path module to Python3 2016-01-20 11:21:06 +01:00
wmayer 281447780b + simplify porting of ReverseEngineering module to Python3 2016-01-20 10:26:50 +01:00
wmayer a643463733 + simplify porting of Test module to Python3 2016-01-20 10:26:12 +01:00
Yorik van Havre fa42bc451a Merge branch 'master' of github.com:FreeCAD/FreeCAD 2016-01-19 22:35:43 -02:00
Yorik van Havre 0d22ca8eaf Path: Added new series of tools and fixes
* Fixed UsePlacement property of Path Compounds
* Added Path FaceProfile command - does a simple 2D contour of a face
* Added Path FacePocket command - does a simple 2D pocket of a face
* Added Path Array command - does an array with copies of a path
* Added Path Custom command - to add custom G-Code
* Added Inspect command - to inspect the G-Code of a path
2016-01-19 22:31:46 -02:00
wmayer cb92240458 + simplify porting of Points module to Python3 2016-01-20 00:00:41 +01:00
Yorik van Havre f480791472 Made last commit non-C++11 compatible 2016-01-19 11:25:16 -02:00
Yorik van Havre 5364a17c50 Merge pull request #78 from ianrrees/20160119-mesh-export-tolerance-preference
Added ability to change mesh export tolerance.
2016-01-19 10:52:21 -02:00
Jose Luis Cercos Pita 3644dcbcab Added a much more robust displacement tool for the GZ computation 2016-01-19 13:16:32 +01:00
Jose Luis Cercos Pita a5d7344f5a Modified the ship shpae transformation process during the hydrostatics computation 2016-01-19 11:16:36 +01:00
Jose Luis Cercos Pita 8cc3e62589 Improved the transversal areas computation 2016-01-19 10:14:02 +01:00
Ian Rees b6a1fd85ea Added ability to change mesh export tolerance. 2016-01-19 20:44:17 +13:00
wmayer 05279d2846 + simplify porting of Raytracing module to Python3 2016-01-18 19:14:57 +01:00
wmayer 108149297f + simplify porting of Robot module to Python3 2016-01-18 18:26:37 +01:00
Jose Luis Cercos Pita 63f976e25a Implemented a draft of the GZ computation tool 2016-01-18 18:04:01 +01:00
Jose Luis Cercos Pita a0a2a1012e Fixed typo in the capacity curve tool 2016-01-18 16:11:02 +01:00
Jose Luis Cercos Pita 7a53c17fde Added a weights and tanks collector 2016-01-18 15:38:44 +01:00
Jose Luis Cercos Pita c99f4921ca Implemented GZ tool variables saving and loading 2016-01-18 14:41:50 +01:00
Jose Luis Cercos Pita cf76a92996 Added console messages to know the computation progress 2016-01-18 13:15:05 +01:00
Jose Luis Cercos Pita ce52c4b024 Set a different color to the z-vol curve (in order to make possible3 to differentiate that from the level-vol curve) 2016-01-18 13:10:53 +01:00
Jose Luis Cercos Pita 3ea9f6245d Removed the uneeded pivy imports 2016-01-18 13:01:23 +01:00
wmayer 65fe62d93b + simplify porting of Sketcher module to Python3 2016-01-18 12:19:54 +01:00
wmayer bfdaa46feb + simplify porting of Sandbox module to Python3 2016-01-18 11:43:20 +01:00
Jose Luis Cercos Pita e002c9e66d Merge remote-tracking branch 'upstream/master' 2016-01-18 10:49:36 +01:00
wmayer 36383135a8 + simplify porting of Spreadsheet module to Python3 2016-01-17 23:15:24 +01:00
wmayer d78d747760 + simplify porting of Start module to Python3 2016-01-17 22:13:32 +01:00
wmayer a467612b9f + simplify porting of Web module to Python3 2016-01-17 19:17:34 +01:00
wmayer 5aea3220c8 + simplify porting of template module to Python3 2016-01-17 19:17:00 +01:00
wmayer 7773ad03c1 + fix bug in animated fit for orthographic camera if view width < height 2016-01-16 00:06:37 +01:00
wmayer 1027801be6 + improve whitespaces 2016-01-15 23:20:52 +01:00
wmayer 372704f44b + implement 'swap' for point kernel class to efficiently copy data 2016-01-15 23:20:06 +01:00
Yorik van Havre 9a27d5845f Draft: fixed gui bug in trimex 2016-01-14 13:39:24 -02:00
wmayer 6ed52e479b + fix crashes in ortho view panel 2016-01-13 17:40:20 +01:00
wmayer ffcbb0b66c + improve error handling in projection panel in Drawing workbench 2016-01-13 14:48:51 +01:00
wwmayer bf151fe5e5 Merge pull request #76 from reportingsjr/master
Change name prefix in the VRML/OpenInventor exporter
2016-01-13 13:54:53 +01:00
wmayer e0ee8bb8ca + allow to open system macros in read-only mode 2016-01-12 01:26:34 +01:00
Yorik van Havre 0ba829de41 Fixed typo in last commit 2016-01-11 22:18:31 -02:00
Yorik van Havre 97aea8a4ed Arch: search for profiles.csv also in current dir 2016-01-11 22:08:02 -02:00
sgrogan 99731988d3 Copy Profiles.csv to data dir of build dir 2016-01-11 21:58:58 -02:00
wmayer db539008be + fix whitespaces 2016-01-11 23:48:59 +01:00
Abdullah Tahiri 8a3958ced5 Gui: Extension of CommandMacro for system-wide macros
=====================================================

What?
Extension of the CommandMacro constructor to take an additional optional argument to indicate that the macro
is located in the system-wide directory, and shall be executed accordingly.
2016-01-11 19:25:53 +01:00
Abdullah Tahiri 3d551450a2 Gui Bug fix: Tabbed support for system-wide macros
===============================================

What?
Implementation of triplus' idea of making user-specific and system-specific macros
having a different list in different tabs.

Fixing of a bug related to the previous "separator".

Suggested terminology.
2016-01-11 19:25:36 +01:00
Abdullah Tahiri f1a3276d37 Bug fix: Add System-wide Macro dir to python path
=================================================

Self explanatory, so that macros in system-wide location can import modules therein.
2016-01-11 19:25:18 +01:00
Abdullah Tahiri 7fc7bdc302 Gui Enhancement: Support for macros in AppUserHome/Macro
=====================================================

What?
It was suggested that the macros should be moved to AppUserHome/Macro
http://forum.freecadweb.org/viewtopic.php?f=10&t=13433

Solution:
The solution is backwards compatible in the sense that if you have a running
configuration, updating should not change anything.

For new installations the macro directory will default to AppUserHome/Macro. However
this would break all the installation scripts (probably also ME's plugin manager).

Conflicts:
	src/Mod/Path/Gui/AppPathGuiPy.cpp
2016-01-11 19:24:22 +01:00
Abdullah Tahiri f78a239167 Gui Enhancement: Support for system-wide macros
===============================================

What?
Support for executing system-wide macros in /usr/lib/freecad/Macro
http://forum.freecadweb.org/viewtopic.php?f=10&t=13433

Why?
To allow to package macros and install them system-wide so that they are available to all users.
2016-01-11 19:22:50 +01:00
Yorik van Havre 5c1ab74329 Target URLs in Help menu are now translatable - fixes #2394 2016-01-11 13:36:42 -02:00
Yorik van Havre 86a1897eca Arch: small encoding fixes 2016-01-11 13:08:28 -02:00
Yorik van Havre cbad63100a Detecting windows10 in about dialog 2016-01-11 13:08:13 -02:00
wmayer 89cb247923 + handle degenerated ellipse for SVG output 2016-01-11 13:01:01 +01:00
Yorik van Havre 1e6a29eecf Path: added slic3r pre script 2016-01-10 19:58:02 -02:00
wmayer 64a20a83cc + PrintError is not part of FreeCAD but FreeCAD.Console 2016-01-09 21:21:17 +01:00
Yorik van Havre fa3d8c4824 Arch: updated license block 2016-01-09 16:13:05 -02:00
Yorik van Havre 6121e8dea4 Arch: new presets system for structures 2016-01-09 16:04:11 -02:00
Abdullah Tahiri 81f216f9e3 Sketcher Bug fix: Solver information update on over-constrained situation
==================================================================================

Why?
if lastDoF<0, then an over-constrained situation has ensued and geometry is not to be updated, as geometry can not follow the constraints.
However, solver information needs to be updated.

Solution:
Just trigger a constraint change so that signaling is sent to ViewProviderSketch via boost and the solver information updated, using
Constraints.touch().
2016-01-09 13:42:12 +01:00
Eivind Kvedalen 3aa44e6b0c Issue #2389: ObjectIdentifiers constructed from a property sometimes do not
resolve correctly, because the resolver may fail if a different document
objects has a Label equal to the property's document object's identifier.
2016-01-08 23:09:00 +01:00
Eivind Kvedalen d53cb8146e Spreadsheet: Issue #2388: The SheetObserver should ignore changed properties that don't have a name. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen 48b699071c ExpressionCompleter: Remove '=' before tokenizing string, to improve completer when used in the spreadsheet. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen a760487ad2 Spreadsheet: Don't update line edit on top unless we have to. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen 160d88c883 Spreadsheet: Clear line edit on top when current cell is cleared. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen 5f26cd9d7c ObjectIdentifier: Resolve document name on both identifier and Label. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen 9cc45e6ff2 ObjectIdentifier::resolve() should set documentName to internal name, not the Label property. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen e523638c75 Spreadsheet: Enable tooltip for error messages. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen 009d0c03b4 Document/PropertyExpressionEngine: Added onDocumentRestored function, to update internals of PropertyExpressionEngine after loading a document from disk. 2016-01-08 23:08:55 +01:00
Eivind Kvedalen 905cd3b1d2 App: Added template<class P> class AtomicPropertyChangeInterface. 2016-01-08 23:08:39 +01:00
Yorik van Havre e740a42075 Removed workbench keyboard shortcut W+0. Now only W+1-9 work. 2016-01-08 10:30:44 -02:00
Yorik van Havre bf19e80de1 Arch: fixed encoding bugs 2016-01-07 15:27:49 -02:00
Yorik van Havre 7691e22c59 Arch: handle ifcopenshell error when shape is not available 2016-01-07 12:09:17 -02:00
Yorik van Havre 7886675faa Changed shortcuts of workbenches to W + number 2016-01-07 11:47:53 -02:00
wmayer 0b3f60a68c + replace use of accessibleName with custom property 2016-01-06 16:59:11 +01:00
Bernd Hahnebach edac98b7ee FEM: small improvements in the regard of flake8 compatiblity 2016-01-06 11:13:38 -02:00
Bernd Hahnebach c60c70eb7b FEM: delete no longer needed EditorMode Setting
the properties are set to read only in the C++ constructor allready.
See commit 1a8c643d50
2016-01-06 11:13:38 -02:00
Bernd Hahnebach 0ba0f7a55d FEM: set solver type property to read only the hard way 2016-01-06 11:13:38 -02:00
Bernd Hahnebach feb8c0685e FEM: make result stats read only in property editor 2016-01-06 11:13:38 -02:00
Yorik van Havre fd14c1e3c3 Draft: small change in DXF pref page layout 2016-01-06 10:56:25 -02:00
Yorik van Havre 5c2ed74292 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2016-01-05 20:20:42 -02:00
Yorik van Havre 87397a2512 Drawing: support for text alignment in Spreadheetview 2016-01-05 20:20:25 -02:00
wmayer 061c67cbf8 + expose onDocumentRestored to Python feature classes 2016-01-05 19:05:48 +01:00
wmayer 53024a6140 + do not include from .qrc generated .cpp file from other .cpp file but add it to build system 2016-01-05 17:35:58 +01:00
wmayer a9189fb052 + use TRUE and FALSE for Vrml output (reverts part of commit 7d0e892d3) 2016-01-05 17:27:56 +01:00
Mateusz Skowroński 7d0e892d36 Qt4's qglobal.h defined TRUE and FALSE. Qt5 does not do it anymore. Replace it with true and false.
https://qt.gitorious.org/qt/qtbase/commit/158f39ec7870c54ff3a15f72fe151062d6daa172

This change is Qt4/Qt5 neutral.
2016-01-05 16:43:33 +01:00
Mateusz Skowroński db345cb624 Change includes in Spreadsheet to be compatible with Qt5.
This change is Qt4/Qt5 neutral.
2016-01-05 16:10:40 +01:00
Mateusz Skowroński 0aa944a1b7 Change includes in Quarter to be compatible with Qt5.
This change is Qt4/Qt5 neutral.
2016-01-05 16:10:02 +01:00
Mateusz Skowroński ab26271756 QAbstractItemModel::reset() is obsolete in Qt5. Use beginResetModel() and endResetModel() instead.
This change is Qt4/Qt5 neutral.
2016-01-05 16:09:12 +01:00
Mateusz Skowroński 9beb7d21f3 QKeySequence::operator QString() is obsolete in Qt5. Use toString(QKeySequence::NativeText) instead.
This change is Qt4/Qt5 neutral.
2016-01-05 16:08:31 +01:00
Mateusz Skowroński 3b463f2138 Qt::WFlags is obsolete in Qt5. Replace it with Qt::WindowFlags.
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:58 +01:00
Mateusz Skowroński cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Mateusz Skowroński d5c074f80d QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:06:48 +01:00
Yorik van Havre e55ba2d24d Added script to check download stats on github 2016-01-05 12:24:57 -02:00
Yorik van Havre c5b8b7c0a4 Draft: fixed bug in DXF export because of last commit - fixes #2391 2016-01-05 12:15:44 -02:00
Yorik van Havre 1e578c4f1a Draft: don't check anymore for python DXF libs if using the C++ importer 2016-01-04 22:19:13 -02:00
Yorik van Havre 273131c088 Draft: finished new DXF importer - fixes #2205 2016-01-04 18:01:34 -02:00
wmayer da83100728 + fix major flaw in Spreadsheet module: do not include precompiled header in other header files
+ fix linking errors in drawing module
2016-01-04 16:03:00 +01:00
wmayer 1d05f9c66e + support cutting of coloured mesh 2016-01-04 14:39:54 +01:00
Jon Neal f46a6965d2 Change name prefix in the VRML exporter to one that is allowed in the standards. 2016-01-04 01:03:18 -05:00
Yorik van Havre 1747fb643f Updated ts files prior to translation cycle 2016-01-03 19:45:29 -02:00
Yorik van Havre 85fdc8c76b Drawing: Add SpreadsheetView command - fixes #1805 2016-01-03 16:44:56 -02:00
wmayer 145fe4a364 + fix build failure with gcc 2016-01-03 19:30:03 +01:00
wmayer b6faaefaf8 + handling of colored mesh in view provider 2016-01-03 01:16:00 +01:00
wmayer dd9e8c5bb1 + make faster reading ply mesh files 2016-01-03 01:14:48 +01:00
wmayer 0ea477b420 + fix rendering bug for colored 2016-01-01 15:37:05 +01:00
wmayer 50d7793442 + introduce proper enum for property status to replace plain integers 2016-01-01 15:36:24 +01:00
wmayer 342198ea87 + support reading mesh files with colors 2015-12-31 21:07:04 +01:00
wmayer e2369996e2 if offscreen rendering for thumbnail fails then only write out application icon 2015-12-31 17:04:56 +01:00
wmayer 5e0f2ae418 + use custom points feature to read in ply with properties 2015-12-31 15:50:56 +01:00
wmayer 3b139c9bb1 + add custom points feature 2015-12-31 15:40:19 +01:00
wmayer 07b36e6bca + extended ply reader based on pcl to read-in attached properties 2015-12-31 15:36:16 +01:00
wmayer c2de4059c9 + add template class to add feature types with dynamic properties but without extended Python binding 2015-12-31 15:34:24 +01:00
wmayer b3bfdaafcf + add overloaded addObject() method to Document class to add existing DocumentObject 2015-12-31 15:32:47 +01:00
wmayer ebbb68d978 + fixes #0002385: unable to set value higher than 99.99 on Distance value in Part->Cross Sections 2015-12-31 12:25:54 +01:00
wmayer 715ae4e225 + fix compiler warning 2015-12-30 16:49:51 +01:00
wmayer 0135094133 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-12-30 16:25:27 +01:00
wmayer 17d7dd840e + add points view feature and command to triangulate it 2015-12-30 16:25:08 +01:00
Yorik van Havre 39a55cf951 Draft: small fix in patterns 2015-12-30 12:30:40 -02:00
wmayer 7d96d0f0c8 + optimize view provider for points, improve white spacing 2015-12-30 15:19:47 +01:00
wmayer 1274967208 + add support to PointKernel to get valid points 2015-12-30 15:18:05 +01:00
wmayer 4e3856acc8 + remove feature classes to import/export points 2015-12-30 15:16:22 +01:00
wmayer ad2c4c23d0 + fix compiler warnings 2015-12-30 10:58:14 +01:00
wmayer c2b66766b2 + optimize algorithm to get curvature on mesh points and drop dependency to WildMagic 2015-12-30 10:26:53 +01:00
wmayer e9e9a38865 + improve exception handling in initialization scripts 2015-12-29 23:42:29 +01:00
Yorik van Havre 9f4dc4616c Merge branch 'master' of https://github.com/jbradsha/FreeCAD into jbradsha-master 2015-12-29 13:00:11 -02:00
Yorik van Havre d989acaae8 Draft: Added a grid toggle button to the snap toolbar 2015-12-29 12:10:22 -02:00
J Bradshaw 9cca015108 Merge pull request #1 from jbradsha/jbradsha-patch-1
Update README.md
2015-12-29 12:08:06 +00:00
Yorik van Havre ed037c138e Arch: Fixed section plane's clipping - fixes #2063 2015-12-28 16:56:53 -02:00
Yorik van Havre 353b2df3d3 Draft: fixed bug when loading objects with pattern set 2015-12-28 12:56:53 -02:00
Yorik van Havre bbfacbc883 Arch: fixed vanishing windows when host wall is hidden - fixes #1604 2015-12-28 12:27:37 -02:00
Yorik van Havre 83954da5cf Renamed menu View->Views to View->Panels 2015-12-28 12:02:20 -02:00
Abdullah Tahiri 86f0454414 Sketcher: Solver: FullPivLU::compute for Eigen-3.3
==================================================

This fix enables usage of the Eigen SparseQR starting in Eigen-3.3. It optimizes the code enabling it
to work with the new assignation interface of Eigen-3.3, which is more strict than that of Eigen-3.2.

It provides the same optimization for DenseQR code, and omits the extraction of the Q matrix in DenseQR
as this is not used anywhere else.

[NOTE: This is only to be merged after Debian has updated the Eigen-3.3-alpha1 package]

See:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12769&start=30#p104740
https://forum.kde.org/viewtopic.php?f=74&t=129115
2015-12-28 11:51:34 -02:00
Abdullah Tahiri e9af05f911 Sketcher: Solver: FullPivLU::compute for Eigen-3.3
==================================================

This fix enables usage of the Eigen own compute function starting in Eigen-3.3, as now it is fixed in Eigen.

[NOTE: This is only to be merged after Debian has updated the Eigen-3.3-alpha1 package]

See:
http://forum.freecadweb.org/viewtopic.php?f=3&t=4651&start=40
http://forum.freecadweb.org/viewtopic.php?f=10&t=12769&start=60#p106492
https://forum.kde.org/viewtopic.php?f=74&t=129439
2015-12-28 11:51:34 -02:00
wmayer e0683f4db0 + fixes #0002347: freecad fails to build with Boost 1.60.0 2015-12-28 13:54:40 +01:00
wmayer 07ba938ff6 + issue: #0002350, handle Python's SystemExit exceptions and do not exit application when running from macro dialog or Python editor 2015-12-27 23:00:59 +01:00
Yorik van Havre 0f9d6c14ae Updated installation page in README 2015-12-27 18:44:08 -02:00
wmayer 24c234b80a + whitespace improvement 2015-12-27 19:16:05 +01:00
Yorik van Havre 1f4f94017a Draft: Unified in-drawing shortcuts with what is shown in the GUI 2015-12-27 14:00:02 -02:00
wmayer 462ec49297 + fixes #0001956: FreeCAD 0.14.370x hangs when attempting to edit sketch containing ellipse 2015-12-27 11:44:47 +01:00
Yorik van Havre e98347960d Draft: x,y and z fields are now auto-masked when second point is horizontal or vertical 2015-12-26 20:19:52 -02:00
Yorik van Havre 71b66ad25a Merge pull request #72 from iHateInventNames/master
fixed default configuring for Gentoo
2015-12-26 18:20:55 -02:00
Yorik van Havre 026dc8678c Merge pull request #73 from wood-galaxy/arch-wall-negative-offset
Arch/Wall : allow negative value to Offset property
2015-12-26 17:57:57 -02:00
Sergei Krivonos 7e6d816034 fixed default configuring for Gentoo
Change-Id: Iae8847950acca023a2a222404d400d3a25794be1
2015-12-26 21:22:58 +02:00
Yorik van Havre 08b79eb4dd Draft: fixed focus on first field when starting a draft command 2015-12-26 13:45:09 -02:00
Yorik van Havre 93ccc88f74 Draft: fixed non-focused taskview fields 2015-12-25 20:05:55 -02:00
wmayer d8088c5db0 + improve whitespaces 2015-12-25 10:56:03 +01:00
wmayer 51c7a8eecc + improve whitespaces 2015-12-25 10:37:52 +01:00
wmayer 632eaeadeb + fixes #0002372: Application terminates on attempt to change external geometry from a sketch
+ fixes #0002373: When Measuring in the distance between two external geometry Freecad crashes
2015-12-25 09:47:25 +01:00
Mateusz Skowroński 9aa3cfb4f9 Add missing QMimeData.h includes.
This change is Qt4/Qt5 neutral.
2015-12-24 13:36:46 +01:00
Mateusz Skowroński c2a31fe04b qVariantValue() is obsolete in Qt4. Replace it with equivalent QVariant::value<T>(value).
This change is Qt4/Qt5 neutral.
2015-12-24 12:49:26 +01:00
Mateusz Skowroński 62ccb845bc QFileDialog::selectFilter() is obsolete in Qt4. Replace it with selectNameFilter().
This change is Qt4/Qt5 neutral.
2015-12-24 12:49:08 +01:00
Mateusz Skowroński 5be2986146 QFileDialog::filters() is obsolete in Qt4. Replace it with nameFilters().
This change is Qt4/Qt5 neutral.
2015-12-24 12:48:49 +01:00
Jonathan Wiedemann 3c0927650d Arch/Wall : allow negative value to Offset property 2015-12-24 03:04:37 +01:00
Yorik van Havre 3bbddc8675 Drawing: Added python feature to ViewProviderDrawingView - fixes #2276 2015-12-23 17:03:46 -02:00
Yorik van Havre aac4205d1d Draft: small fix in trimex snap mode 2015-12-23 15:19:03 -02:00
wmayer ff806af026 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-12-23 15:44:38 +01:00
wmayer 4f2291f420 + implement property editor item for FEM mesh 2015-12-23 15:44:11 +01:00
wmayer b55defa4f3 + add missing comma in property item 2015-12-23 15:43:29 +01:00
Jonathan Wiedemann 7913e608be Arch : Add Align property to StructuralSystem 2015-12-23 12:35:01 -02:00
Yorik van Havre a1f82e443e Draft: small fix in Arch Axes SVG output 2015-12-23 12:13:29 -02:00
Yorik van Havre 94dd07297d Draft: Fixed display of Arch axes on Drawing views 2015-12-23 11:55:34 -02:00
Yorik van Havre 474c114e66 Arch: fixed projection of Drawing views of arch sectionplanes - fixes #2233 2015-12-23 11:32:36 -02:00
Yorik van Havre 38d90ab4c2 Draft: Fixed arc bug in DXF export - fixes #2208 2015-12-22 11:54:55 -02:00
Mateusz Skowroński 99ca18f541 QInputDialog::getInteger() is obsolete in Qt4. Replace it with getInt().
This change is Qt4/Qt5 neutral.
2015-12-22 14:18:47 +01:00
Mateusz Skowroński e6379ea636 QFileDialg::selectedFilter() is obsolete in Qt4. Replace it with selectedNameFilter().
This change is Qt4/Qt5 neutral.
2015-12-22 14:18:46 +01:00
Mateusz Skowroński d3d01db9e2 QFileDialg::setFilters() is obsolete in Qt4. Replace it with setNameFilters().
This change is Qt4/Qt5 neutral.
2015-12-22 14:18:45 +01:00
Mateusz Skowroński 4d85f0e40b QWidget::setShown() is obsolete in Qt4. Replace it with setVisible().
This change is Qt4/Qt5 neutral.
2015-12-22 14:18:45 +01:00
Mateusz Skowroński f7b8135ded Add missing forward declaration of QPrinter to MDIView.h.
This change is Qt4/Qt5 neutral.
2015-12-22 05:44:52 +01:00
wmayer 7c359b7b30 + handle exceptions when restoring dynamic properties 2015-12-21 18:24:12 +01:00
Yorik van Havre eca0e54bf3 Arch: small encoding bugfix 2015-12-21 12:37:57 -02:00
Yorik van Havre aad6ef004d Arch: improvements to Axis - fixes #2138
* Fixed small bugs
* More options to position the bubble (start, end or both)
* Properties for text size and font
2015-12-21 12:21:31 -02:00
Eivind Kvedalen fca2e2671a PropertyConstraintList: Use correct indices when checking the constraint type. 2015-12-21 14:11:14 +01:00
Eivind Kvedalen df660dc280 PropertyExpressionEngine/DocumentObject: Track object deletes and update dependencies accordingly. 2015-12-21 14:11:13 +01:00
Eivind Kvedalen 7b25d454b5 PropertyExpressionEngine::slotObjectRenamed(...): return immediately if the property's owner is not part of an object (e.g on the undo stack). 2015-12-21 14:11:13 +01:00
Eivind Kvedalen 9c7b9ed2c0 PropertyExpressionEngine::slotObjectRenamed(...): only change the object if it is absolutely necessary,
or else the object will in most cases be touched, leading to unnecessary recomputes.
2015-12-21 14:11:12 +01:00
Eivind Kvedalen 65a610d1cb Expression/ObjectIdentifier: changed return type of renameDocumentObject and renameDocument,
to be able to signal that a rename actually took place.
2015-12-21 14:11:12 +01:00
Eivind Kvedalen 83d221e161 DocumentObject: Don't emit signal if Label hasn't actually changed. 2015-12-21 14:11:11 +01:00
Yorik van Havre 19fd2c3195 Arch: set the Lenght property of walls automatically when based on baselines 2015-12-20 12:41:25 -02:00
Yorik van Havre 5fa85ad31b Draft: disabled moving siblings when moving an object 2015-12-19 22:32:56 -02:00
Yorik van Havre d6920a07c3 Arch: Walls now adopt the current working plane orientation on creation - fixes #2175 2015-12-19 12:53:20 -02:00
wwmayer eb5ec62ccb Merge pull request #71 from ianrrees/20151216-3dconnexion-mac
Fixed paths for 3Dconnexion headers on Mac
2015-12-19 14:19:58 +01:00
wmayer 0b0d258afd + make method cancelObservation() not pure virtual 2015-12-19 11:31:59 +01:00
Ian Rees bdc519743c Fixed paths for 3Dconnexion headers on Mac 2015-12-19 15:08:54 +13:00
Yorik van Havre 5b750aabe3 Arch: Creating windows no longer removes external refs from base sketches - fixes #2326 2015-12-18 22:11:53 -02:00
wmayer 73a716c82f Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-12-18 22:48:53 +01:00
Eivind Kvedalen 823b5205bb NumberExpression: Added std::setprecision to keep precision of number in double to string conversion. 2015-12-18 22:05:32 +01:00
Eivind Kvedalen 6f39eed25e PropertyPlacement: Fixed setting of angle (missing deg to radian conversion). 2015-12-18 22:05:31 +01:00
Eivind Kvedalen 7760c6ac18 ObjectIdentifier: Added std::setprecision to keep precision of double to string conversion. 2015-12-18 22:05:31 +01:00
Eivind Kvedalen db2f868bbe Sketcher: Fixed setPathValue to convert angles to radians before they are stored in the Constraint object. This mimics the setDatum implementation. 2015-12-18 22:05:30 +01:00
Yorik van Havre dab7ef4262 Draft: workaround for exporting DXF with R14+ templates - fixes 2177
- Adapted Drawing algos to export R14+ compatible DXF code
- Added option in DXF prefs to disable groups (not supported in R14+ templates)
2015-12-18 10:47:14 -02:00
Yorik van Havre 45292eb9ee Arch: IFC bugfix + added pref option to use DAE triangulation options 2015-12-18 10:39:40 -02:00
Yorik van Havre cfba4a3d5c Changed default shortcuts for 10 first workbenches from CTRL+number to ALT+CTRL+number 2015-12-18 10:39:27 -02:00
wmayer 24c60199cc + improve getting proper group name from Python module path name 2015-12-17 18:56:40 +01:00
wmayer 5ac4a6fa91 + improve getting proper group name from Python module name 2015-12-17 10:41:01 +01:00
Yorik van Havre 6d237ed63b Merge pull request #70 from DeepSOIC/fixReplaceChild
OpenSCAD: fix replaceChild
2015-12-16 23:25:28 -02:00
DeepSOIC 4057de6346 OpenSCAD: fix replaceChild
was broken because it failed trying to set a read-only
"ExpressionEngine" property
2015-12-17 03:34:16 +03:00
wmayer 61e1a5ca2f + use Python's inspect module to get calling instance of addCommand 2015-12-16 23:07:24 +01:00
wmayer f958dadb69 + improve autoload mechanism to get commands of custom toolbars 2015-12-16 21:19:12 +01:00
DeepSOIC 4f2992db54 API: improve built-in docu for copyObject and moveObject 2015-12-16 20:45:54 +03:00
DeepSOIC dd8027a839 API: fix document.copyObject not working when with dependencies
copyObject failed with an error when attempting to copy an object with
dependencies from one document to another.

http://forum.freecadweb.org/viewtopic.php?f=22&t=13533&p=108288#p108288
2015-12-16 20:45:53 +03:00
Yorik van Havre 43e0083c72 Draft: Added editmode to facebinders - fixes #2165 2015-12-16 15:30:43 -02:00
wmayer 9a3211c343 + extend Inventor builder to support material nodes 2015-12-16 16:09:31 +01:00
Jonathan Wiedemann 2669aa6206 Allow negative value in Draft's pref : Ext Line size 2015-12-16 13:03:46 +01:00
Yorik van Havre e71787d37a Draft: fixed bug in wire offsets - fixes #1975 2015-12-15 11:11:57 -02:00
Yorik van Havre 472e6b777a Draft: shape2Dview now projects along the current view direction - fixes #2367 2015-12-14 19:32:35 -02:00
wmayer acf3b34711 + implement PropertyExpressionEngine::getPyObject 2015-12-13 22:40:07 +01:00
wmayer f7a2ffc457 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-12-13 19:19:58 +01:00
wmayer 1a8c643d50 + make properties of FEM result object read-only for property editor 2015-12-13 19:19:38 +01:00
Yorik van Havre c850d622b7 Draft: Added properties to subdivide rectangles into columns and rows - fixes #2340 2015-12-13 12:32:43 -02:00
Yorik van Havre c66be818b9 Path: added .gcode extension to available gode file formats 2015-12-13 12:31:53 -02:00
wmayer f26844e1bc + allow to clear installed firewall 2015-12-13 14:36:41 +01:00
wmayer f46393efe7 Report 'None' for successfully executed commands in server, implement a simple firewall to block commands 2015-12-13 14:24:15 +01:00
wmayer 33c9c02aeb + limit display role of property list items to 10 elements 2015-12-13 12:01:16 +01:00
wmayer e305f079d0 + when using FreeCAD GUI as Python module handle attempt to re-create main window 2015-12-12 20:14:37 +01:00
Yorik van Havre 97311dfd0a Merge remote-tracking branch 'sgrogan/Idf-fix' 2015-12-12 13:00:36 -02:00
Yorik van Havre 5949d79bed Merge pull request #69 from timthelion/patch-1
Application.cpp English editing
2015-12-12 12:43:06 -02:00
Yorik van Havre 18346619ae Draft: Changing text or arrows of a Dimension now marks it to be recomputed 2015-12-12 12:31:36 -02:00
Timothy Hobbs 7da3c663c6 Application.cpp English editing
Edit English in comments and warning messages
2015-12-12 01:22:14 +01:00
Yorik van Havre 3dcc557e65 Draft: more consistent behaviour for Clones when trying to edit them - fixes #2198 2015-12-11 11:08:30 -02:00
Bernd Hahnebach 0f7a13a8a8 FEM: fix loading frequency in solver control command 2015-12-11 13:32:23 +01:00
sgrogan 4d4d292cf0 Make Idflibs consistent for installed and uninstalled builds 2015-12-10 16:37:25 -05:00
Yorik van Havre be9920a132 Arch: obj exporter now skips bad objects instead of stopping 2015-12-10 15:46:09 -02:00
wmayer 36ac2e7032 Fix element A41 in 4x4 Matrix class 2015-12-10 17:35:54 +01:00
Yorik van Havre b7a9bf9505 Merge pull request #68 from l3iggs/patch-1
fixes #0002358
2015-12-10 13:23:11 -02:00
Yorik van Havre d65c96099e Draft: Lines and Wires now have a Subdivisions property - fixes #1593 2015-12-10 13:20:48 -02:00
l3iggs 4901553a2d fix for 0002358
This strips off any trailing '-' text reported by openscad when asking it for its version.
2015-12-10 14:50:01 +00:00
wmayer dde207c360 + fix: -Wunused-variable 2015-12-09 16:52:47 +01:00
wmayer 7e261db1a2 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-12-09 15:09:57 +01:00
Yorik van Havre b876489b46 Arch: small fix in Structure - fixes #2186 2015-12-09 11:30:51 -02:00
Stefan Tröger dcad131357 Expressions: Fix property editor behavior
- change responsibility of python code emition
- Correct python code handling for expressions
- handle constraints expressions handling
2015-12-09 14:08:50 +01:00
Stefan Tröger 580a4e15d1 Expressions: port int spinbox for property editor 2015-12-09 14:08:49 +01:00
Stefan Tröger 4203a6f35b Expressions: Integrate into the property editor
- basic infrastructure for handling of expressions
- port the unit properties editor to support expressions
- port placement editor to support expressions
- expressions for double spinbox
- expressions in sketch constraints
2015-12-09 14:08:48 +01:00
Abdullah Tahiri 501fa80e4d Sketcher: Fix Sketch Mirror functionality
=========================================

The problem:
Mirror stopped working.

How to reproduce:
Select a sketch, and apply "Mirror Sketch" from the menu.

Why?
With the introduction of expressions, mirror sketch stopped working. The reason is that mirror functionality did use the "clone" function to make copies of constraints
and then modify their values. After expessions introduction, which introduces a unique tag per constraint, this copy was regarded as a "rename" of the original constraint
as they shared the unique tag.

Fix?
New function "copy()" for a constraint, that copies all the content but the tag.
2015-12-09 13:32:12 +01:00
wmayer 118d2eb531 + fix typo in FEM 2015-12-09 13:19:13 +01:00
wmayer 69a6970975 + fix crash when undoing creation of spreadsheet 2015-12-09 13:18:58 +01:00
Eivind Kvedalen ae6b934207 Spreadsheet: Fixed PropertySheet::Paste(); undo did not work correctly. 2015-12-09 12:15:15 +01:00
Eivind Kvedalen aef7bbdf62 Spreadsheet: AggregateFunctionExpression missed its own implementation of copy().
This causes a crash during undo if this class is used.
2015-12-09 12:15:15 +01:00
Eivind Kvedalen 4d0af95caf App: Replaced freecad_dynamic_cast by static_cast. In this case we know the type, and don't check for 0. 2015-12-09 12:15:14 +01:00
Eivind Kvedalen 71605e63ef Spreadsheet: Fixed issue #2352, removal of rows and columns. 2015-12-09 12:15:13 +01:00
Eivind Kvedalen 4b5ae54e88 App: Removed VariableExpression::setName(), and replace call by setPath(); it's use caused a crash (#2352). 2015-12-09 12:15:12 +01:00
Yorik van Havre c67b2bed45 Draft: Fixed offset of arcs - fixes #1993 2015-12-08 12:01:28 -02:00
wmayer c0ee5fbae3 + add restart method to timer 2015-12-07 17:31:05 +01:00
Yorik van Havre a97992a537 Arch: added button to edit text position in Arch Spaces edit mode - fixes #2339 2015-12-07 12:30:20 -02:00
Yorik van Havre 1da0ec65c3 Draft: added radial & diameter dim support to DXF import - fixes #2162 2015-12-05 16:50:30 -02:00
Yorik van Havre 2e91633da9 Draft: Added mirror tool (more graphical version of Part Mirror) - fixes #2215 2015-12-05 14:19:35 -02:00
Yorik van Havre cf3e69de08 Arch: removed global state of ifcfile 2015-12-05 13:49:02 -02:00
Bernd Hahnebach 6d2877444c Arch: ifc: fix import of archobj walls if structobj import is activated 2015-12-05 13:46:34 -02:00
wmayer 93b53f1662 + add several surface reconstruction methods from pcl to Reen module 2015-12-05 16:19:18 +01:00
Yorik van Havre fd191b802e Draft: Fixed grid jump in edimode - fixes #2104 2015-12-03 22:59:50 -02:00
Bernd Hahnebach 9e114a8b59 FEM: make cccFrdReader flake8 compatible 2015-12-03 18:50:06 -02:00
fandaL cf22522290 FEM: frd mesh import rearrange repeating if 2015-12-03 18:50:06 -02:00
fandaL 98cd075a84 FEM: frd import mesh - added HEX20, PENTA6, PENTA15 2015-12-03 18:50:06 -02:00
Bernd Hahnebach 32624cbe94 Arch: on ifc import do no longer decode unicode strings before encode them 2015-12-03 18:46:23 -02:00
Yorik van Havre cf1c02271f Draft: more consistent offset result - fixes #2027 2015-12-03 18:25:32 -02:00
Yorik van Havre 3414ec8af1 Arch: IFC importer doesn't choke anymore on rebars 2015-12-02 21:51:27 -02:00
Yorik van Havre 7594bb6f31 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-12-02 21:31:28 -02:00
Yorik van Havre 047998de87 Draft: other bugfix in downgrade - fixes #2260 2015-12-02 21:31:23 -02:00
Yorik van Havre d0dac0c658 Draft: fixed bug in downgrade - fixes #2261 2015-12-02 21:25:37 -02:00
wmayer 7eb7be3936 + add Poisson surface reconstruction 2015-12-02 23:36:26 +01:00
Yorik van Havre 1acf487040 Arch: Added more meshing options for Collada exporter - fixes #2341 2015-12-02 18:42:30 -02:00
Yorik van Havre 9f4c54d33a Draft: small bugfix 2015-12-01 22:14:59 -02:00
wmayer 2b2358e70b + fix warnings with Win32 build 2015-12-01 00:51:57 +01:00
wmayer 244054ff1f + reorder header to fix warnings with Win32 build 2015-11-30 20:38:19 +01:00
Yorik van Havre fd802bad80 Arch: Allow to draw walls by entering length, width and height on the GUI - fixes #2000 2015-11-30 15:40:52 -02:00
Yorik van Havre a557cd4cc5 Draft: fixed buggy global copy mode 2015-11-30 15:39:43 -02:00
Bernd Hahnebach c78f57a78a FEM: fix node order of seg3 in ViewProwiderFemMesh 2015-11-30 11:21:51 -02:00
Bernd Hahnebach d8af8693b4 FEM: fix node order of seg3 (B32) in writeAbaqus 2015-11-30 11:21:51 -02:00
Yorik van Havre 8bc013140e Draft: Fixed arrows at endpoints of wires - fixes #2066 2015-11-29 12:47:06 -02:00
wmayer 76c238fc98 + fixes #0001860: Can not open a FreeCAD project in FreeCAD by double-clicking the project file on Macintosh 2015-11-29 15:36:47 +01:00
Bernd Hahnebach b2080f945a FEM: fix not closing taskd of _CommandSolverJobControl 2015-11-28 20:04:22 -02:00
Bernd Hahnebach ea2a0d12c2 FEM: do not allow to add multiple soler with gui 2015-11-28 20:04:22 -02:00
Bernd Hahnebach ce3284624f FEM: make selection of quick analysis consistent with solverJobControl 2015-11-28 20:04:22 -02:00
Bernd Hahnebach f3a1ef31db FEM: raise exception if multiple solver or mesh are in an analysis, they are not yet supported 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 592e26fc41 FEM: replace Calculix with CalculiX in strings 2015-11-28 20:04:22 -02:00
Bernd Hahnebach a25c4ac7da FEM: delete FemExample since there is no example inside 2015-11-28 20:04:22 -02:00
Bernd Hahnebach fb7153d5fe FEM: delete not used import FemGui 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 9d2d92336e FEM: rename modul MechanicalAnalysis to FemAnalysis 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 03d1d32e38 FEM: rename command MechanicalJobControl to SolverJobControl 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 882db04b3c FEM: activate CommandMechanicalJobControl with_Solver selected 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 181262b39d FEM: rename TaskPanelJobControl to TaskPanelFemSolverCalculix 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 39c3662da8 FEM: include calculix solver objekt if new analysis is created 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 42913ca0cf FEM: fix test frame work 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 6865e35fd9 FEM: add CalculiX solver object 2015-11-28 20:04:22 -02:00
Author qingfengxia 80cf664ec8 FEM: new solver object implementation of the object 2015-11-28 20:04:22 -02:00
Author qingfengxia 3918d9fbe5 FEM: new solver object icon 2015-11-28 20:04:22 -02:00
Bernd Hahnebach 006bf802f4 FEM: fix some line endings 2015-11-28 20:04:22 -02:00
Yorik van Havre 9d0f4ba46e Arch: Added editmode to Section Planes - fixes #2098 2015-11-28 14:51:40 -02:00
wmayer 6111f55a89 + correctly handle toggle selection in BRep shape nodes 2015-11-28 16:21:20 +01:00
Abdullah Tahiri 19c840e1ab Sketch: Solver: Extended Advanced Solver configuration
========================================================

This is an advanced setting just for allowing increased choices to power users that have problems with a given sketch and want to
test different flavours of DogLeg algorithm.

This commit does not change the default behaviour of FreeCAD. It is only intended to give more options to power users.

The advanced solver configuration is extended to support three different Gauss-newton steps for DogLeg:

FullPivLU => h_gn = Jx.fullPivLu().solve(-fx);
LeastNormFullPivLU => h_gn = Jx.adjoint()*(Jx*Jx.adjoint()).fullPivLu().solve(-fx);
LeastNormLdlt => h_gn = Jx.adjoint()*(Jx*Jx.adjoint()).ldlt().solve(-fx);

This setting is applied only to DogLeg. It is applied to DogLeg as normal or redundant solver, if DogLeg is the selected solver.

Selecting a solver different from DogLeg for both normal and redundant disables the setting.

We have been told:
https://forum.kde.org/viewtopic.php?f=74&t=129439#p346104

that our default Gauss-Newton step in DogLeg may not be adequate in general (we generally deal with underconstraint systems
unless we have a fully constraint sketch, and even then it is many times overconstraint at least for redundant solving).

We have been told that maybe these LeastNorm options are more suitable for us (performance set aside). This enables you as power
user to test if it works fine with FreeCAD.
2015-11-28 13:08:31 +01:00
Abdullah Tahiri aa6908b144 Sketch: Solver Defaults: Sketch size multiplier OFF
===================================================

This commit sets the sketch size multiplier OFF by default (so the number of iterations DogLeg/BGFS/LM is not sketch size dependent).

In complicated sketches having a high number of parameters, with sketch multiplier on, the number of iterations is extremely high (100 parameters*100 iterations => 10000 iterations).

The idea of disabling this comes from tests performed by DeepSOIC and from my own experience using the Sketcher. In general
sketch multiplier makes FreeCAD unresposive (very high amount of iterations, not a real freeze) in big sketches so that users
end up killing the application. This is preventing the users from taking appropriate action, Developers from getting the information of the failure and
users angry.

The idea is that even for complicated sketchs N iterations (100 by default) should be enough to converge, if it is ever going to converge. Experience will tell us
if we have to increase this number in the range [100-300]. 100 iterations in complicated dossiers is in my experience generally under 30 seconds.

N.B.: This commit does not change the defaults stored in your computer, so if you have the sketcher multiplier on, the advanced solver dialog will still enforce this local setting. You
may disable it or click the "defaults" button to disable the sketcher multiplier.
2015-11-28 13:08:24 +01:00
Eivind Kvedalen 87c6af3547 Spreadsheet: Removed setPosition() function. 2015-11-28 12:56:28 +01:00
Eivind Kvedalen b7480210fd Spreadsheet: Issue #2301: Handle enter/return and tab keys the same as e.g OpenOffice and Excel. 2015-11-28 12:56:27 +01:00
Eivind Kvedalen 2e5175c7be Spreadsheet: Fixed typo. 2015-11-28 12:56:26 +01:00
Eivind Kvedalen 45a2207f81 Spreadsheet: Improve python code when the Delete key is pressed. 2015-11-28 12:56:25 +01:00
Pablo Gil 8b745b3751 Adds the ViewFitSelection to the main toolbar (improves usability) 2015-11-27 10:59:15 +01:00
wmayer 559194edab + do view fit only on file import if document was empty 2015-11-26 20:24:00 +01:00
wmayer 898e0fb359 + make API of InventorBuilder more flexible and add new methods 2015-11-26 15:27:40 +01:00
Yorik van Havre e0f3bb00b8 Relocated the WB switcher to its original location 2015-11-26 09:11:39 -02:00
Yorik van Havre 3d6869bf68 Added automatic Ctrl+Number shortcuts for the 10 first woekbenches 2015-11-26 09:11:39 -02:00
Yorik van Havre 7c5e8d58cb Split workbench selector and placed it left 2015-11-26 09:11:39 -02:00
wmayer b3e0e8272f Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-11-25 21:02:17 +01:00
wmayer 6a6a2d5669 + fix whitespaces 2015-11-25 21:02:00 +01:00
Abdullah Tahiri 7c1c56a550 Sketcher: Solver Debug functionality: Ability to export a subsystem
===================================================================

It allows to export the c++ code to create a subsystem with the same information as the one solved using LM/DL/BGFS.

In this commit the functionality is disabled (for production).

To enable the functionality uncomment this line in planegcs/Constraints.h:
//#define _GCS_EXTRACT_SOLVER_SUBSYSTEM_

When enabled, upon solving with LM/DL/BGFS, the c++ code to generate the subsystem is added to a subsystem.txt that is created in the FreeCAD
execution directory.

Note that the file is created in append mode, so it will append all normal/redundant solvings until the file is deleted.

The resulting code can be directly pasted into a project similar to:
https://github.com/abdullahtahiriyo/Eigen_LUPiv_Convergence

Such a project only has libeigen as external dependency.
2015-11-25 20:39:04 +01:00
Yorik van Havre 14a771bf05 Arch: small fix in Arch git dialog 2015-11-25 13:17:54 -02:00
Yorik van Havre a5852dd8f2 Material: Fixed the material editor dialog, thanks to rockn 2015-11-24 22:57:50 -02:00
wmayer a029d90a98 FEM: Rename Display Modes 2015-11-23 18:17:10 +01:00
Abdullah Tahiri ad1210f4bb Sketcher: Advanced solver dialog bug fix LM-tau
================================================

Due to a typo the code was setting LM-tau to 1E-80 by default instead of the intended 1E-3.
2015-11-21 22:48:02 +01:00
wmayer bb1add4739 + Add export macro to Enumeration class 2015-11-21 22:46:42 +01:00
wmayer 2362239edf + Add Python example of embedding FreeCAD 2015-11-20 22:35:26 +01:00
Bernd Hahnebach 8ebf64ac3f FEM: add nodes of quad8, hexa20, penta6, penta15, pyra5, pyra13 to ViewProvider nodes are displayed 2015-11-19 19:01:23 +01:00
Bernd Hahnebach 758f3ec77e FEM: FemMesh VP throw exception instead of assert(0) 2015-11-19 19:01:07 +01:00
Bernd Hahnebach 2f5706262d FEM: add SMESH supported volumes to Python API of FemMesh 2015-11-19 19:00:52 +01:00
wmayer c8e241c9f3 + PLate surface approximation 2015-11-19 18:52:19 +01:00
wmayer 13e2b24ddf + add Python binding to Plate surface 2015-11-19 15:27:35 +01:00
Przemo Firszt fe522bc66b FEM, Tests: Fix line end problem in compare_inp_files
Add new function to force unix line ends and use it in compare_inp_files
and compare_stats.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-19 10:26:24 +01:00
DeepSOIC ed8eab273d API: Update docu strings of methods of BSplineCurve
Mainly exposing argument types and meanings, but also updating a few
descriptions by copy-paste-editing documentation of corresponding
OpenCASCADE.
2015-11-19 02:53:48 +03:00
Przemo Firszt c9cfc369d6 FEM: Use exisitng mesh property as link to mesh in result objects
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-18 11:22:02 +00:00
Przemo Firszt 3788670038 FEM: Tidy up long lines and spacing
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-18 11:21:27 +00:00
wmayer 3268acf9a2 + set object name to tool buttons with popup menu 2015-11-17 18:39:23 +01:00
wmayer 267f66539a Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-11-17 12:22:30 +01:00
wmayer c159a8ddc2 + fix inconsistencies in using DynamicProperty class 2015-11-17 12:22:07 +01:00
wmayer a839a13b59 + fix build failure with gcc 2015-11-16 23:21:47 +01:00
wmayer 78e9319587 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-11-16 22:48:00 +01:00
wmayer 1225a7ac06 + support of adding/removing dynamic properties in property editor 2015-11-16 22:47:29 +01:00
Bernd Hahnebach d37ac54c8e FEM: fix mixed line endings in VP FemMesh 2015-11-16 19:19:01 -02:00
Bernd Hahnebach 49b002beaf FEM: Mesh VP fix FreeCAD crash if not supported face is added to VP 2015-11-16 19:19:01 -02:00
Bernd Hahnebach eec2b56629 FEM: add some documentation to FemTools 2015-11-16 19:19:01 -02:00
Bernd Hahnebach 01d3b3ecad FEM: substitute some camel style variable names in frdReader 2015-11-16 19:19:01 -02:00
Bernd Hahnebach d14e79eafa FEM: use proper command to create a Mechanical Anaylsis with all properties 2015-11-16 19:19:01 -02:00
fandaL 36ffb450f1 FEM: frd import mesh 2015-11-16 19:18:11 -02:00
Przemo Firszt dee8809454 FEM, Tests: Force unix line ends for comparing calculation stats
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-16 19:15:44 -02:00
Yorik van Havre 58b41b9550 Arch: Fixed flipped Space names 2015-11-16 16:11:32 -02:00
wmayer ba21766096 + property editor handles case when dynamic property is removed 2015-11-16 15:24:36 +01:00
wmayer 4f4d747968 + fix undefined behaviour in determining grid length for planar meshes 2015-11-16 11:59:41 +01:00
Przemo Firszt 629a89218d FEM: Fix Von Mises calculation formula and update FEM test results
Reported-by: fandaL
Fixed-by: fandaL
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-14 14:53:37 +01:00
Przemo Firszt b0fbd60835 FEM: Use format to avoid error is the message is not pure string
Traceback (most recent call last):
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/TestFem.py", line
229, in test_new_analysis
    ret = self.compare_stats(fea, static_expected_values)
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/TestFem.py", line
147, in compare_stats
    fcc_print(sf_content)
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/TestFem.py", line
55, in fcc_print
    FreeCAD.Console.PrintMessage(message + '\n')
TypeError: can only concatenate list (not "str") to list

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-14 14:53:36 +01:00
wmayer 7848d08121 + properly handle case of degenerated bounding box when creating mesh grid 2015-11-14 14:08:01 +01:00
wmayer 821cd696c5 + do not set edit mode for spreadsheet 2015-11-14 02:18:29 +01:00
wmayer 53d323b5e0 + make isReadOnly & isHidden of PropertyContainer non-virtual 2015-11-14 02:07:57 +01:00
Eivind Kvedalen 081bc6b107 QuantitySpinBox: Make sure Python code is emitted also when expressions are not used.
In that case, the property should be set directly.
2015-11-13 20:26:13 +01:00
DeepSOIC 61a3997ef2 API: update distToShape built-in docu
It was way too short, and incorrect
2015-11-13 18:13:20 +03:00
wmayer 48027e1586 + fix memory leaks 2015-11-13 16:06:43 +01:00
wmayer 45af17e39c + Code cleanup:
+ do not include header of itself
+ do not include unneeded header files
+ removed unneeded forward declarations
+ do not translate C string to get a QString
+ break too long lines
+ replace tabs with spaces
+ use virtual keyword on destructors
2015-11-13 15:47:03 +01:00
wmayer bf0d8d68bb + Add selected sketches to one Face, implement specialized view provider for Face 2015-11-13 13:38:24 +01:00
wmayer 6944658bd4 + Add parametric feature to create face from sketches 2015-11-12 19:44:24 +01:00
Bernd Hahnebach 74270c23d2 FEM: allow to make a mesh from shape without an analysis 2015-11-12 13:39:51 +01:00
Bernd Hahnebach 78ac00180f FEM: fromShape not needed modul loading deleted 2015-11-12 13:37:11 +01:00
Przemo Firszt 391cdf816d FEM: Update except catch to python3
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-11 22:41:12 +00:00
Przemo Firszt 1e8e0877f3 FEM: Windows workaround to avoid blinking terminal window
Reported-by: wmayer
Tested-by: wamyer, sgrogan
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-11 22:21:21 +00:00
Przemo Firszt f74e016f30 FEM: Fix unexpected error with ccx_* unset if Popoen fails
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-11 22:20:34 +00:00
Przemo Firszt e90ed4bf65 FEM: Cheange margins in TaskPanelMechanicalAnalysis for Analysis Type
Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-11 21:47:36 +00:00
Mateusz Skowroński f3860faaef Fix file encoding. Go from ISO8859-1 to UTF-8. 2015-11-11 18:54:42 +01:00
wmayer 4af7d95a6d + support of linear b-spline/bezier curves and planar b-spline/bezier surfaces to get direction 2015-11-11 18:27:26 +01:00
Bernd Hahnebach e22431ea77 FEM: use ConsolePrints instead off print in beamsection and shellthickness 2015-11-11 09:14:50 +01:00
Bernd Hahnebach c6989acd55 FEM: use new selection observer class for material reference shape selection 2015-11-11 09:14:50 +01:00
Bernd Hahnebach ba394818a3 FEM: separate selection observer class from _TaskPanel shellthickness and beamsection 2015-11-11 09:14:49 +01:00
wmayer dc20525edc + don't switch tab when creating new web page 2015-11-10 17:32:55 +01:00
wmayer 7546a39b12 + Allow to open link in new web view 2015-11-10 16:40:04 +01:00
Eivind Kvedalen be5e79601a PartDesign: Fixed similar issue compared to #2302 with unit handling when using an expression for the chamfer size. 2015-11-09 21:37:24 +01:00
Eivind Kvedalen acd0f6a79e PartDesign: Fixed issue #2302 with unit handling when using an expression for the fillet radius. 2015-11-09 21:37:08 +01:00
wmayer dff58e5df3 + fix documentation of task dialog 2015-11-09 19:22:19 +01:00
wmayer d3280a0b82 + when trying to close a document then do it even if a task dialog is open 2015-11-09 19:21:56 +01:00
Bernd Hahnebach 9d856fbd7a FEM: use addItem to add list items in shellthickness, beamsection and multimat ref shape list 2015-11-08 13:44:37 +01:00
Bernd Hahnebach 5e234486b2 FEM: rename uis of python task panels to TaskPanelName 2015-11-08 09:32:01 +01:00
Bernd Hahnebach 5e001f3e15 FEM: delet unused import FreeCAD 2015-11-07 20:04:10 +01:00
Bernd Hahnebach 062895c626 FEM: sort modules in CMakefiles 2015-11-07 18:36:28 +01:00
Bernd Hahnebach c542a88e5e FEM: move CalculiX test files to test_files/ccx directory 2015-11-07 17:23:31 +01:00
Bernd Hahnebach 737fa891f8 FEM: make Init.py flake8 compatiple 2015-11-07 16:41:31 +01:00
Bernd Hahnebach b1e67a7e0a FEM: use unix linefeeds in Init.py 2015-11-07 16:41:22 +01:00
Bernd Hahnebach d10d18bd4d FEM: rename ObjectsTaskPanel into TaskPanelObjects 2015-11-07 16:41:11 +01:00
Bernd Hahnebach 7847c6fcac FEM: print console message if a task dialog is open already for beamsection and shellthickness 2015-11-07 13:24:45 -02:00
Bernd Hahnebach ea6e65f9f8 FEM: add author to material files 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 81cf730791 FEM: unused imports deleted 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 05a20ecc77 FEM: split MechanicalMaterial into separate modules 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 49c12c5e3d FEM: use ConsolePrints instead of prints for MechanicalMaterial 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 746bad9f18 FEM: shape typte test in selection of multiple material reference shapes 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 3ef7d3ce3a FEM: put prints in brackets in MechanicalMaterial 2015-11-07 13:24:45 -02:00
Bernd Hahnebach cb690eca62 FEM: multiple materials, support for solids 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 0c55f927f5 FEM: add getNodesBySolid()
Conflicts:
	src/Mod/Fem/App/FemMesh.cpp
2015-11-07 13:24:45 -02:00
Bernd Hahnebach 52ad0bcc9d FEM: selection of Faces and Edges as References for multiple MechanicalMaterial 2015-11-07 13:24:45 -02:00
Bernd Hahnebach cb0a48c849 FEM: add Reference selection to Mechanicalmaterial ui 2015-11-07 13:24:45 -02:00
Bernd Hahnebach 8cb6ed7d6a FEM: multiple materials for shell and beam meshes 2015-11-07 13:24:45 -02:00
Bernd Hahnebach f02ba31d02 FEM: add spaces to FemTools license 2015-11-07 13:24:45 -02:00
wmayer 94a62e015c + allow to set u/v dirs for B-Spline fit 2015-11-06 16:43:58 +01:00
wmayer 9bb0e7f75e + fix build failure on Linux 2015-11-06 14:56:19 +01:00
wmayer 0bb6dc4cf1 + add task dialog to perform B-Spline fit 2015-11-06 14:30:26 +01:00
wmayer d6bbc0ad0f + add helper classes to store names of doument and object and not a pointer 2015-11-06 14:28:03 +01:00
wmayer 8645d56acf + get initial plane fit from B-Spline fit if required 2015-11-06 00:27:33 +01:00
wmayer 25fd2adb03 + fixes #0002329: remove the 2 now obsolete Pivy versions distributed with FreeCAD source code 2015-11-05 21:26:05 +01:00
wmayer e8048a4968 + fix build failure with occ 6.9.1 2015-11-05 19:40:34 +01:00
Bernd Hahnebach 39d6d68366 FEM: use super class FemCommands for ShellThickness and BeamSection Commands 2015-11-05 17:31:03 +01:00
Bernd Hahnebach 59bafd51c0 FEM: split FemBeamSection into separate modules 2015-11-05 17:31:02 +01:00
Bernd Hahnebach 5d9954d3da FEM: split FemShellThickness into separate modules 2015-11-05 17:31:02 +01:00
Bernd Hahnebach c3328d6b4e FEM: use unix linefeeds in InitGui.py 2015-11-05 17:31:02 +01:00
wmayer 44a54e417c + (hopefully) fix build failure with occ 6.9.1 2015-11-05 17:06:04 +01:00
wmayer 3d8d6eca5e + implement mechanism to allow only a single application instance 2015-11-05 15:56:50 +01:00
wmayer 899199daf5 + move GuiApplication class into its own source files 2015-11-04 22:04:48 +01:00
wmayer e5f805a773 + optimize B-spline approximation 2015-11-04 14:39:20 +01:00
wmayer 38ca335a1f + check if pcl is built opennurbs support 2015-11-04 12:16:35 +01:00
Przemo Firszt 64950056b8 FEM: Fix typos in property definitions
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
Przemo Firszt d025f1e109 FEM: Replace invalid ElementNumbers with NodeNumbers
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
Przemo Firszt a85c68aa65 FEM: Add EigenmodeFrequency property to result object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
Przemo Firszt 9531c0b088 FEM: Add Eigenmode property to result object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
Przemo Firszt 30e2ec315b FEM: Add simple dat file reader
It's a simple CalculiX dat file reader used to extract eigenmode
frequencies after freqyency analysis.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
Przemo Firszt 3e20529210 FEM: Remove redundant base_name variable
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 20:04:23 +00:00
wmayer 919d47015a + support of drag'n'drop for custom view provider 2015-11-03 16:21:51 +01:00
wmayer 06d3926603 + extend interface of Document.setEdit() according to the doc string 2015-11-03 12:36:29 +01:00
Przemo Firszt d2469cac6e FEM: Replace GetString with GetFloat/GetIntiger for eigenmode parameters
Reported-By: bernd
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-11-03 10:50:15 +01:00
wmayer 466d1a60b1 + optimize B-spline approximation 2015-11-03 00:55:15 +01:00
wmayer 2d4d60d2ab + allow in approxSurface() to also pass points object 2015-11-02 17:36:45 +01:00
wmayer 85ac79aaf2 + double check that internal data is valid when leaving edit mode of sketcher view provider 2015-11-02 12:42:18 +01:00
wmayer caec2d98a0 + fixes #0002321: Build failure on current (71be79e) master 2015-11-01 18:07:56 +01:00
wmayer 71be79e09e + add toggle action to context-menu of spline view provider 2015-10-31 16:10:26 +01:00
wmayer ff320f465f + ignore colour information of ply point files 2015-10-31 16:09:38 +01:00
wmayer 77f148350b + reorder include files to fix re-definition of macro BOOST_PARAMETER_MAX_ARITY 2015-10-31 13:32:01 +01:00
DaviKaur 0120942c46 Materials: New Glass Materials 2015-10-31 13:01:39 +01:00
wmayer 212e2bf19c + include pcl bspline fit into Reverse Engineering module 2015-10-30 22:06:34 +01:00
Yorik van Havre e7d16c5f62 Arch: added IFC export preference option to choose triangulation style for non-planar shapes 2015-10-28 17:24:43 -02:00
Przemo Firszt fc8e2eed64 FEM, Tests: Fix FEM tests
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-26 18:35:43 +00:00
Przemo Firszt 50ab6a3111 FEM: Move writing inp section headers to front of function
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-26 17:17:23 +00:00
Bernd Hahnebach cc3fee5f9c FEM: print in brackets 2015-10-26 13:13:57 +01:00
Bernd Hahnebach 02be8e65ab FEM: fix in ccxfilewriter for ccxelset if multiple materials and beam mesh 2015-10-26 13:13:56 +01:00
Bernd Hahnebach 13e7841b41 FEM: edge load ccxwriter fix if duplicate edges in refshapes 2015-10-26 13:13:55 +01:00
Bernd Hahnebach e5adec94b7 FEM: ccxwriter, much more exact results for cload on edges 2015-10-26 13:13:55 +01:00
Bernd Hahnebach 9c0bcb7a7c FEM: cload in ccxwriter, some changes in preparation for adding better edge load calculation 2015-10-26 13:13:54 +01:00
Bernd Hahnebach 7b1a4f1297 FEM: add defs to make the code better reuseable for cload on edges 2015-10-26 13:13:53 +01:00
Bernd Hahnebach c74a8392de FEM: small changes in shellth and beamsec task panel 2015-10-26 13:13:52 +01:00
triplus 6fe2923d52 OpenSCAD IncreaseTolerance (edges and faces support) 2015-10-26 11:48:20 +01:00
wmayer 8fa41edc04 + fixes #0002306: Allow *.py files in the Customize/Macros/Macro dropdown 2015-10-26 09:42:27 +01:00
wmayer e3221376e1 + use right namespace for template instantiation to fix linker errors on Windows 2015-10-25 23:06:21 +01:00
wmayer 15a6a463b3 + need dummy class for FeaturePython class to work 2015-10-25 22:42:50 +01:00
wmayer a3cd03ac03 + fix comment, convert native separators to UNIX separators 2015-10-25 14:16:38 +01:00
Przemo Firszt d58ccf7fd3 FEM: Use brackets for print
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:30 +01:00
Przemo Firszt e3c081be54 FEM: Use eigenmode number to decide if we're dealing with frequency analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:29 +01:00
Przemo Firszt 098e46f686 FEM: Fix invalid check for frequency analysis
eigenmode = 0 for static and it's greater than 0 for frequency analysis.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:29 +01:00
Przemo Firszt 304e71e371 FEM: Remove imported but not used FreeCADGui
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:28 +01:00
Przemo Firszt cf979fa040 FEM: Do not activate FEM wb from ccxFrdReader
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:27 +01:00
Przemo Firszt 55bc72b7b4 FEM: Make sure result_object exist before accesing it
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:26 +01:00
Przemo Firszt bba3543efe FEM: Initialise result_object to None to fix crash on empty results
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:25 +01:00
Przemo Firszt 80b82dd955 FEM: Fix invalid check for empty resutls
Even when readResult was not producing any resuts the check was passing
fine as len({'Nodes': {}, 'Tet10Elem': {}, 'Results': []}) is 3

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:25 +01:00
Przemo Firszt 3dcc189e8b FEM: Add new properties to FEM preferences
The new properties are NumberOfEigenmode, EigenmodeHighLimit and
EigenmodeLowLimit. All 3 are linked with analysis object properties.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:24 +01:00
Przemo Firszt 6ab7a434ac FEM, Tests: Make sure eigenmode parameters are always the same.
The parameters were taken from FEM prefs, so the test could fail.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:23 +01:00
Przemo Firszt 068ba4793d FEM: Add EigenmodeHighLimit property to analysis object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:22 +01:00
Przemo Firszt 042ded01e0 FEM: Add EigenmodeLowLimit property to analysis object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:22 +01:00
Przemo Firszt fcf19ff8ec FEM: Add NumberOfEigenmode property to analysis object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:21 +01:00
Przemo Firszt 26cd01e346 FEM: Add WorkingDir property
that allows to set individual directory to be used for each analysis
object

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:20 +01:00
Przemo Firszt 8055b189be FEM: Use AnalysisType in FemTools by default
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:19 +01:00
Przemo Firszt 89b74a5231 GUI: improve App::PropertyPath directory selector
Editing direcotry in lineEdit was open to escaped character problems
i.e. \t or \n which can be pert of notmal directory path were converted
to tab or new line. Also leaving the lineEdit without hitting Enter was
discarding changes.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:19 +01:00
Przemo Firszt 15dbd1055a App: Fix typo in description of PropertyFloatConstraint
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-25 12:46:18 +01:00
wmayer 977411b4cc + check input of approxSurface for obviously wrong values 2015-10-25 12:46:02 +01:00
wmayer b1ea3f70da + move module Python stuff into C++ class 2015-10-24 18:16:17 +02:00
wmayer e82a780774 + move module Python stuff into C++ class 2015-10-24 18:04:53 +02:00
wmayer c336f0757c + do error checking of input values and use keywords conforming with attributes of BSplineSurface 2015-10-24 15:40:24 +02:00
wmayer fe7c3cda44 + extend Python interface of approxSurface 2015-10-23 17:56:24 +02:00
wmayer 6fecb87053 + fix documentation 2015-10-23 16:15:23 +02:00
wmayer abec1c4b1d + improve whitespaces, replace floats with doubles 2015-10-23 15:32:54 +02:00
wmayer 67d8469069 + fix bug in B-Spline approximation 2015-10-23 13:52:58 +02:00
wmayer 1c90c3794d + remove unused line in CMake file 2015-10-23 11:08:22 +02:00
Abdullah Tahiri e1dd86f0a9 Sketcher: Bug fix: unable to move geometry after addition of a constraint
=========================================================================

This fixes issue:
http://www.freecadweb.org/tracker/view.php?id=2281

Discussed in:
http://forum.freecadweb.org/viewtopic.php?p=101910#p101910

How to reproduce?
With Auto-Update mode unchecked, execute the sequence in the bug tracker. You will reach to a geometry assembly successfully solved that can not be moved.

Why?
The coincident constraint is partially redundant within the meaning of redundancy of the solver.
The solve within "addconstraint" in SketchObjectPy.cpp causes the geometry to move to meet the coincident constraint.
At the end of the solve, the initial solution used in diagnostics is no longer valid (the geometry moved). This causes a subsequente move not to be executed.

The Solution:
Recalculate just the initial solution after the addition.
2015-10-23 00:13:20 +02:00
Abdullah Tahiri fc128d357d Sketcher: Solver information: Bug fix
=====================================

When the solver converged (but did not succeed) or when the solver succeded but the solution is not OCC-valid, no error message was shown in the solver messages dialog.
2015-10-22 23:48:04 +02:00
Przemo Firszt 4fb15f2a1b FEM: Move module loading to InitGui.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-22 11:20:03 +01:00
wmayer 60c8180079 + fix initialization order in initFemGui 2015-10-22 11:11:47 +02:00
wmayer abd6e8c438 + proper exception handling of FemGui module 2015-10-22 11:01:21 +02:00
wmayer 62da38339f + allow to set parameters for surface triangulation from outside 2015-10-21 23:18:53 +02:00
J Bradshaw 726a514e3c Update README.md 2015-10-21 10:50:24 +01:00
wmayer e7a3dc48e8 + support of Python feature classes without an execute() method
+ if execute() method of Python feature is missing or if it returns false call the execute() method of the C++ feature
+ fix SketchObjectPython
2015-10-21 00:22:40 +02:00
Jose Luis Cercos Pita 74ed253f51 Improved the objects representation 2015-10-20 13:09:40 +02:00
Jose Luis Cercos Pita 9b6b171b04 Using the smart expression in the spreadsheet to manage the entities labels 2015-10-20 13:05:27 +02:00
Jose Luis Cercos Pita c16c27cd0e Merge remote-tracking branch 'upstream/master' 2015-10-20 10:53:52 +02:00
wmayer 169b2e356e + clean-up, fix and new methods added in unit test module 2015-10-19 21:51:43 +02:00
Przemo Firszt 28abf3585b FEM: remove comment lines for _CommandNewMechanicalAnalysis.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:08 +02:00
Przemo Firszt ffdc7a45df FEM: change purge_results to operate on analysis document
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:08 +02:00
Przemo Firszt 499630034b FEM: improve enabling/disabling commands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:07 +02:00
Przemo Firszt f76933eb87 FEM: Migrate _CommandMechanicalMaterial to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:07 +02:00
Przemo Firszt ddb20e7329 FEM: Remove Frequency Analysis from GUI
Separate Frequency analysis button is no longer required.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:06 +02:00
Przemo Firszt 35632147ad FEM: Add new analysis properity AnalysisType
To run frequency analysis user have 2 options:
1. Run normal aalysis, set "frequency" and start ccx
2. Set Analysis Type in Analysis object properties to "frequency" and
use Quick Analysis

With that workflow we no longer need a separate button for frequency
analysis. Also it's much easier to prepare & run a dediacted analysis
for frequency calculiations and separate analysis objects for
different load cases.
2015-10-19 21:28:05 +02:00
Przemo Firszt 2c21325353 FEM: Remove not used OutputDir analysis property
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:05 +02:00
Przemo Firszt f33f573199 FEM: Change the way set_analysis_type works - use FEM prefs
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:04 +02:00
Przemo Firszt 26d18db2d3 FEM: Make sure ccx working dir is set
Also TestFem and check_prerequisities are corrected

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:04 +02:00
Przemo Firszt b79cc695a1 FEM: Add AnalysisType to Prefs and use it in analysis control window.
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:03 +02:00
Przemo Firszt d5cf69b646 FEM: Make sure it's clear what failed when ccx is not set and cannot be found
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:02 +02:00
Przemo Firszt d8488027d7 FEM: Fix WorkingDir problem
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:01 +02:00
Przemo Firszt 23dd479cb9 FEM: Typo + move debug print to be the first command in calculixStarted
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:01 +02:00
Przemo Firszt 6116231e32 FEM: Rename pushButton_generate to pb_run_ccx
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:28:00 +02:00
Przemo Firszt 14740f9202 FEM: Rename pushButton_edit to pb_edit_inp
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:59 +02:00
Przemo Firszt 7c0a53596c FEM: Rename pushButton_write to pb_write_inp
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:58 +02:00
Przemo Firszt 50bcdaa90f FEM: Rename label_Time to l_time
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:58 +02:00
Przemo Firszt cf7f82c48a FEM: Move known_analysis_type definition to class definition
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:57 +02:00
Przemo Firszt f0951065c9 FEM: print should use brackets for python3 compatibility
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:56 +02:00
Przemo Firszt cfc2a4d1f2 FEM: Fix invalid exception raise call
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:55 +02:00
Przemo Firszt ac0f3a650d FEM: Test ccx binary before use
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:54 +02:00
Przemo Firszt 554f4f5fc9 FEM: Add documentation to FemTools
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:54 +02:00
Przemo Firszt da7d499595 FEM: Constraints should be enabled only when there is an active analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:53 +02:00
Przemo Firszt eda566e572 FEM: Use fem-constraint-pulley and fem-constraint-gear icon names
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:52 +02:00
Przemo Firszt 0b310174ee GUI: Add completer to directory selector
Directory selector now suggest directory names

Probably similar fixes should be applied to FileChooser in File mode

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:51 +02:00
Przemo Firszt 8c93b29737 GUI: Fix invalid selection mode in PropertyPathItem::createEeditor
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-19 21:27:51 +02:00
wmayer e416ec0dc3 + add more unit tests for bounding box 2015-10-19 17:27:55 +02:00
wmayer 861dc86093 + make FEM beam section and shell thickness ready for drag and drop 2015-10-19 14:48:07 +02:00
wmayer eff27994e5 + Do not rely on active document but active analysis object 2015-10-18 22:36:36 +02:00
wmayer 5e48d2ec33 + make Python API of Selection consistent to C++ API 2015-10-18 19:50:47 +02:00
wmayer 969b43bb64 + improve active document handling 2015-10-18 19:35:15 +02:00
wmayer 00cdea7b74 + allow to activate an analysis object from context-menu 2015-10-18 16:10:32 +02:00
wmayer 9257e9471f + allow that an object cannot be set to edit mode 2015-10-18 16:09:25 +02:00
wmayer 337a36ceb8 + write out nodes sorted by id to abaqus file 2015-10-18 12:32:09 +02:00
Przemo Firszt a0d8042bff FEM, Tests: Add setting static analysis
The tests from GUI were failing if FEM prefs were set to frequency analysis

Debugged by: sgrogan

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-17 12:20:48 -03:00
Przemo Firszt b4352a18d1 FEM, Tests: Include detailed information in test report after failure
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-17 12:20:48 -03:00
Przemo Firszt 7554d2a8a8 FEM, Tests: Close files as soon as possible
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-17 12:20:48 -03:00
wmayer ad96714fe8 + issue #0002245: BRep File cannot be written 2015-10-17 17:13:27 +02:00
wmayer 692e9e6b96 + fixes #0002291: Invalid sketch warning should allow to directly open sketch validation tool 2015-10-17 15:34:14 +02:00
wmayer 051ad564d1 + use correct context for translatable strings in ViewProviderSketch 2015-10-17 15:21:37 +02:00
wmayer 4208b0840d + truncate text when too long in message box in unit test panel and show the full text in detailed section 2015-10-17 14:33:54 +02:00
wmayer b6c2f8f822 + Allow to select item in completion box with mouse 2015-10-17 13:40:47 +02:00
wmayer efd3a494d7 + fixes #0002297: 'Export to PDF...' from drawing view does not show an error if existing file can not be overwritten 2015-10-17 00:31:30 +02:00
wmayer 9abedaf0d2 + fix & suppress msvc warnings 2015-10-16 18:26:30 +02:00
Yorik van Havre a36bf71632 Draft: fixed small bug in Draft unit test 2015-10-16 12:38:49 -03:00
Jose Luis Cercos Pita ee070344ee Slightly improved the load condition data sheet 2015-10-16 13:50:00 +02:00
Jose Luis Cercos Pita 1f74c1d413 Filtered out the bad entities from the ship before the load condition generation 2015-10-16 13:43:04 +02:00
Jose Luis Cercos Pita 1d00b9f250 Fixed the unclaimed load conditions 2015-10-16 13:00:31 +02:00
Jose Luis Cercos Pita 5467d0aec2 Created utilities to purge usless data inside the Ship instance 2015-10-16 12:58:23 +02:00
Jose Luis Cercos Pita bd594136a0 Added DATA identifier to the headers 2015-10-16 11:53:27 +02:00
Jose Luis Cercos Pita 02e908ae18 Added tooltips to the checkboxes 2015-10-16 11:53:07 +02:00
Jose Luis Cercos Pita bfebdaeb16 Merge remote-tracking branch 'upstream/master' 2015-10-16 11:15:44 +02:00
Jose Luis Cercos Pita d28faee03a Imported the areas curve tool improvements from sourceforge 2015-10-16 11:14:53 +02:00
Jose Luis Cercos Pita b8ede9747a Imported the loading conditions definition tool from sourceforge 2015-10-16 11:13:09 +02:00
wmayer 2e6c94fc8e + suppress kdl related warnings with msvc 2015-10-15 19:18:07 +02:00
Yorik van Havre 52d5b8ab7f Robot: Added missing header in KDL 2015-10-15 11:55:52 -03:00
Yorik van Havre ba2e003b92 Added changes to KDL brought after the SVN merge, where applicable
Taken from commits 470880e, df4c99f, cd0ae20, efb0823, c519989
2015-10-14 18:00:22 -03:00
Yorik van Havre 9304f7a78a Added Juergen's original changes to KDL 2015-10-14 18:00:11 -03:00
Yorik van Havre 1908e852f0 Added doxygen fixes from svn commit 3590 to KDL 2015-10-14 17:59:50 -03:00
Yorik van Havre 9f4e7c4085 Upgraded KDL to latest version 2015-10-14 17:59:25 -03:00
wmayer 85994d17b8 + replace || operator in BoundBox2D with real function names 2015-10-14 18:45:13 +02:00
Yorik van Havre 409ee71087 Path: removing leftover KDL stuff 2015-10-14 11:18:10 -03:00
Yorik van Havre e380001762 Fixed Path's cmake file 2015-10-13 17:22:05 -03:00
Yorik van Havre 167b094258 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-10-13 16:44:33 -03:00
Yorik van Havre e4ac34ecb0 Path: Removed KDL/Robot dependency 2015-10-13 16:44:09 -03:00
Przemo Firszt cddb6aa390 FEM: Migrate _CommandQuickAnalysis to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:06 +02:00
Przemo Firszt b122cb5866 FEM: Migrate _CommandMechanicalShowResult to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:05 +02:00
Przemo Firszt 6725c540a6 FEM: Migrate _CommandMechanicalJobControl to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:04 +02:00
Przemo Firszt 1ad481b435 FEM: Migrate _CommandFemFromShape to FemCommands and add new is_active type
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:03 +02:00
Przemo Firszt 217103affb FEM: Migrate _CommandPurgeFemResults to FemCommands and add new is_active type
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:03 +02:00
Przemo Firszt 044c16d218 FEM: Migrate _CommandNewMechanicalAnalysis to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:02 +02:00
Przemo Firszt f1f67b2298 FEM: Add FemCommand class and use it in _CommandFrequencyAnalysis
FemCommand class will gather all common functions/propertied od FEM gui
commands. That should allow to reduce some common code.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-13 21:41:01 +02:00
Yorik van Havre 60ac7e4cb8 Sketcher's GCS solver fixed for eigen3.3 2015-10-13 16:38:35 -03:00
Abdullah Tahiri dc224265fa Sketcher: Bug fix: Constraints dissapear after a sketch loses support
=====================================================================

Issue:
http://freecadweb.org/tracker/view.php?id=2292

Constraints dissapear after a sketch loses support

Steps To Reproduce:
1. Make a sketch on a face.
2. Constrain it
3. Select "reorient sketch"
4. Do you want to lose support? Yes
5. Click cancel on the reorientation dialog.
6. Enter edit mode: No constraints...

Why?
GeoUndef not checked when deleting all external geometry (on dettaching from the support).

Solution:
Check for GeoUndef.
2015-10-13 21:32:55 +02:00
wmayer 1d04ce9ea0 + port SurfaceFit to Eigen3 and add unit tests 2015-10-13 20:03:47 +02:00
Jose Luis Cercos Pita d63348acf9 Started the GZ tool 2015-10-13 18:39:19 +02:00
Jose Luis Cercos Pita 925b861fc0 Generated the User Interface for the GZ tool 2015-10-13 18:38:54 +02:00
wmayer 5cc7f8b10c + remove Py_TPFLAGS_BASETYPE flag for all generated Python bindings because they can't be sub-classed in Python 2015-10-12 19:59:58 +02:00
wmayer 706d159339 + fixes #0001368: Subclassing Matrix silently fails 2015-10-12 18:29:00 +02:00
Przemo Firszt aac2b26c11 FEM: Don't call _ViewProviderMechanicalMaterial in headless mode
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:59:07 +02:00
Eivind Kvedalen e2650860cc Spreadsheet: Expressions using a spreadsheet cell address are now correctly renamed when rows/columns are removed/inserted. 2015-10-11 09:41:16 +02:00
Eivind Kvedalen 29695a8ae7 Spreadsheet: Removed unused function. 2015-10-11 09:41:15 +02:00
Eivind Kvedalen a80ccb9451 Spreadsheet: Renaming an alias will now traverse the document and update expressions referencing it. 2015-10-11 09:41:15 +02:00
Eivind Kvedalen 9fe3b0146a Spreadsheet: Added alias as tooltip. Made background of cell light yellow if an alias is defined for it. Can be overridden by setting a background color. 2015-10-11 09:41:14 +02:00
Eivind Kvedalen e334ac3aed Spreadsheet: Added direct alias command. 2015-10-11 09:41:14 +02:00
Przemo Firszt 27cfcc5995 FEM: Add licence and module info to _Command files
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:42 +02:00
Przemo Firszt 9b816905f1 FEM: Move _CommandNewMechanicalAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:41 +02:00
Przemo Firszt cf8ef4d9bc FEM: Move _CommandFemFromShape class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:41 +02:00
Przemo Firszt dfb2335421 FEM: Move _CommandMechanicalJobControl class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:40 +02:00
Przemo Firszt 7a0c300aa3 FEM: Move _CommandPurgeFemResults class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:39 +02:00
Przemo Firszt 039b632758 FEM: Move _CommandQuickAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:39 +02:00
Przemo Firszt fc12db7b26 FEM: Remove get_results_object from MechanicalAnalysis.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:38 +02:00
Przemo Firszt ad68cad1bf FEM: Move _CommandFrequencyAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:38 +02:00
Przemo Firszt dec1563c95 FEM: Move _CommandMechanicalShowResult class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:37 +02:00
Przemo Firszt d6392b751a FEM: Move _FemAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:36 +02:00
Przemo Firszt c5d0fd8d4b FEM: Move _ViewProviderFemAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:36 +02:00
Przemo Firszt 0f71211602 FEM: Move _JobControlTaskPanel class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:35 +02:00
Przemo Firszt e3a7a7955e FEM: Move _ResultControlTaskPanel class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-11 09:36:35 +02:00
wmayer a4d1dbe5f0 + rework BoundingBox class and its Python binding 2015-10-11 00:18:53 +02:00
wmayer 716130c39e + fix error message in PySide check macro 2015-10-10 10:08:24 +02:00
wmayer 9aa5f7b3a5 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-10-10 09:49:05 +02:00
wmayer f295ac470a + fix warning 2015-10-10 09:48:45 +02:00
Bernd Hahnebach 48d67aa4cd FEM: fix beamsection property in CalculiX file writer 2015-10-09 17:39:40 +02:00
Bernd Hahnebach 41852c4c50 FEM: use MechanicalMaterial instead App::MaterialObjectPython in TestFem 2015-10-09 08:19:24 +02:00
Bernd Hahnebach a7f96cb838 FEM: only change MechanicalMaterial object if taskd is accepted 2015-10-09 08:19:24 +02:00
Bernd Hahnebach 57b65cf405 FEM: add space to licence according flake8 2015-10-09 08:19:24 +02:00
Bernd Hahnebach 177e0d2665 FEM: typo in GUI 2015-10-09 08:19:23 +02:00
Bernd Hahnebach b51155e289 FEM: use generic get_elset methods in CalculiX file writer 2015-10-09 08:19:23 +02:00
Bernd Hahnebach 6ece75789b add config for arcanist 2015-10-09 08:19:23 +02:00
wmayer c133457da5 + when running a bound macro check if file exists, proper unicode handling of macros in customize dialog 2015-10-08 12:37:30 +02:00
wmayer 52957ffcb5 + When adding new commands to custom toolbar set user data if required in order to move them up/down 2015-10-08 11:13:10 +02:00
wmayer 70d86ce907 + add security checks to SoBrep nodes 2015-10-07 23:08:03 +02:00
wmayer 7ca6bb4072 + Prefer prefix ++/-- operators for non-primitive types 2015-10-07 14:29:49 +02:00
wmayer b7be7aec13 + Prefer prefix ++/-- operators for non-primitive types 2015-10-07 13:38:17 +02:00
wmayer 5a78a6ab79 + Prefer prefix ++/-- operators for non-primitive types 2015-10-07 11:32:38 +02:00
wmayer 4909d628f5 + fixes #0002287: Entry Point Not Found IsWow64Process 2015-10-07 10:24:35 +02:00
Eivind Kvedalen b68ae65f56 Sketcher: Fixed keeping sign of constraints. 2015-10-06 21:26:22 +02:00
wmayer f53a691bba + Prefer prefix ++/-- operators for non-primitive types 2015-10-06 21:16:44 +02:00
wmayer 48bf07e622 + split file extension from descriptive text of file format to avoid that invalid translation breaks file dialog 2015-10-06 18:45:06 +02:00
wmayer 967eead27a + split file extension from descriptive text of file format to avoid that invalid translation breaks file dialog
+ add method to make image view unclosable for user
+ fix possible crash in MeshAlgorithm::GetMeshBorder
+ fix possible crash in MeshAlgorithm::ConnectLines
2015-10-06 17:28:52 +02:00
wmayer 72a260cc6e + clear highlighting when re-creating shape 2015-10-06 00:19:43 +02:00
Bernd Hahnebach 24a3b27150 FEM: add brackets to print statements in CalculiX file writer 2015-10-05 18:34:07 +02:00
Bernd Hahnebach f19d4c44df FEM: rewriting some defs in CalculiX input file writer 2015-10-05 18:33:52 +02:00
Bernd Hahnebach d86b0e8f76 FEM: CalculiX writer, rename elset for solid meshes 2015-10-05 18:33:33 +02:00
Bernd Hahnebach 33fed6a630 FEM: add licence information to CalculiX inpwriter 2015-10-05 18:33:16 +02:00
Bernd Hahnebach f411000a0f FEM: add calculiX input file comment lines to FemTest input file diff 2015-10-05 18:33:01 +02:00
Bernd Hahnebach b2262058c8 FEM: visual output for beam and shellelements added 2015-10-05 18:32:38 +02:00
Bernd Hahnebach b4d99aa570 FEM: fix in ShellThicness and BeamSection 2015-10-05 18:32:18 +02:00
Bernd Hahnebach 2b89aab8f3 Fem: fix in ShellThickness selectionobserver 2015-10-05 18:25:57 +02:00
wmayer 30b5311aa4 + fix clang warnings, fix wrong characters 2015-10-05 17:59:19 +02:00
wmayer 0b47413fe1 + fix module dependency of Start and Web 2015-10-04 13:33:43 +02:00
wmayer 3998bd7f98 + fix warnings: -Wunused-private-field and -Wtautological-compare 2015-10-04 13:27:44 +02:00
wmayer c5246875b1 + remove SubWindow flag on OSX to put the expression input on top and get focus 2015-10-04 12:54:25 +02:00
wmayer aa5b388f4a + unlimit the value for occurrences 2015-10-04 10:32:58 +02:00
wmayer 36dd6946a9 + fix clang warnings 2015-10-02 23:32:01 +02:00
wmayer e4768c1c75 + fix clang warning: -Woverloaded-virtual 2015-10-02 20:42:16 +02:00
Przemo Firszt 4b00fe91ab Travis CI: Add internal tests
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-10-01 12:18:28 +02:00
wmayer 232623d372 + fix build failure on Windows 2015-09-30 16:37:48 +02:00
Eivind Kvedalen 5dc75b73bf PartDesign: bugfix, invoke ui->spinOccurrences->apply(). 2015-09-30 15:54:19 +02:00
Eivind Kvedalen 9a0c58986f PartDesign: Replaced QuantitySpinBox by SpinBox for "occurrences" input field. 2015-09-30 15:54:19 +02:00
Eivind Kvedalen cbb4c52310 SpinBox: Added expression binding functionality. 2015-09-30 15:54:18 +02:00
Eivind Kvedalen 014bb5b519 QuantitySpinBox: Moved getIcon() and some data members to ExpressionBinding class.
Conflicts:
	src/Gui/QuantitySpinBox.cpp
2015-09-30 15:54:17 +02:00
Eivind Kvedalen 5826a6ccb3 QunatitySpinBox: Removed unused code. 2015-09-30 15:54:16 +02:00
Eivind Kvedalen cab8111292 Removed PropertyExpressionEngine::getPaths() method. 2015-09-30 15:54:16 +02:00
Eivind Kvedalen 145452120c Added various options to silence warnings when compiling salomemesh with clang. 2015-09-30 15:54:15 +02:00
Eivind Kvedalen eecb6f3536 Spreadsheet: Fixed too liberal decoding of cell addresses. 2015-09-30 15:54:14 +02:00
Yorik van Havre f439208282 Merge pull request #54 from cpollard1001/DPIFixes
Made slight tweaks for high DPI displays
2015-09-29 23:45:32 -03:00
Jan Kantert a2ef7f244d properly add layer for blocks during export 2015-09-29 10:46:36 -03:00
wmayer d248e8f914 + always save macro before executing 2015-09-29 10:00:23 +02:00
Chris Pollard 4a802befbb Made slight tweaks for high DPI displays 2015-09-28 13:42:00 -04:00
Abdullah Tahiri 94851bc14f Sketcher Bug fix: External geometry shown after reorient
========================================================================

Reported here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12517&p=100388#p100429

Solution:
When a sketch loses support, all external geometry is deleted right away.
2015-09-28 11:45:06 +02:00
Abdullah Tahiri 56c29e27f7 Sketcher: Bug fix: Building Vertex Index on Restore
===================================================

The bug was introduced by myself here:
https://github.com/FreeCAD/FreeCAD/commit/47c0859c1b702b6c7d1dcf5922317c4f325f5d2e

[code]
void SketchObject::onDocumentRestored()
 {
     try {
-        rebuildExternalGeometry();
+        if(Support.getValue()) {
+            validateExternalLinks();
+            rebuildExternalGeometry();
+        }
         Constraints.acceptGeometry(getCompleteGeometry());
     }
[/code]

The issue is that "rebuildExternalGeometry" calls "rebuildVertexIndex". So for any sketch not having external geometry, if you open it, select everything and hit del, you will have a crash because
I effectively removed the creation of the index in this dossier. You won't have one if you do anything rebuilding the index before hitting del, like creating geometry, though.
2015-09-28 11:42:56 +02:00
Abdullah Tahiri 01ba165d9a Bug fix: deletion of groups of external geometry
================================================

Issue reported inter alia here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12380#p99456

How to reproduce:
1. Make an external geometry hexagon (make a hexagon, pad it, make a sketch on a hexagonal face and make all the lines external geometry)
2. Box select the external lines and press "del"

On the first pressing of "del" 3 lines were deleted and 3 remained, select again, on the second press 1 remains, select again, on the last press all are deleted.

Why?
Internal and External geometry were handled together in a single set. Group deletion of geometry is effected starting from the highest index,
so that upon deleting an element, the index of the remaining elements does not change. Handling both groups together caused that the external geometry
was actually deleted on the inversed order (as they are (decreasing) negative values for representation, but increasing positive indexes in the external geometry array).

Solution:
Internal and External geometries are handled separatedly
2015-09-28 11:14:30 +02:00
wmayer e9594501dd + use dedicated exception classes for expression and parsing errors 2015-09-27 23:17:33 +02:00
wmayer ee28daa669 + replace old C casts with static_cast in generated C++ code, remove unused parent structure of Python classes, support of -1 as return value of setCustomAttributes 2015-09-27 22:08:08 +02:00
wmayer 6fea753584 fix warnings 2015-09-27 22:05:01 +02:00
wmayer 0ef3a052c3 + ignore color of PLY file for point clouds 2015-09-27 22:04:16 +02:00
wmayer cff628737b To see if the DlgExpressionInput can be closed check if it's under the cursor
Add some test code to deal with modal dialogs on Windows
2015-09-27 16:56:44 +02:00
wmayer cc446b1c5a + fix gcc warnings 2015-09-27 11:25:39 +02:00
wmayer fa5b160887 + fix export of ASCII STL 2015-09-27 10:58:51 +02:00
wmayer 309373c404 + fix transparent background for Windows systems
+ set application-wide event filter and handle mouse press events
+ fix expressPosition() to return exact position of line edit
+ fix warnings in ui file
+ use DlgExpressionInput as non-modal dialog in QuantitySpinBox
2015-09-26 19:36:11 +02:00
Stefan Tröger 98ed315b2d Enhance expression icon
- fix size and position on kubuntu
- different icon for set or unset expression for better visual feedback
2015-09-26 19:09:07 +02:00
Stefan Tröger ae033fc046 Fix usability bugs of new expression input
- click on background closes popup
- size on open is now correct if expression is set initially
2015-09-26 19:09:07 +02:00
Stefan Tröger 96998d390a first take on alternative expression ui input dialog 2015-09-26 19:09:07 +02:00
Yorik van Havre 6a93d1392d Merge pull request #53 from wood-galaxy/equipement-fix
Arch : Fix ViewProviderComponent if vobj have not DiffuseColor attribute
2015-09-25 15:23:55 -03:00
wood-galaxy c94c203843 Arch : little fix in ArchComponent 2015-09-25 20:02:38 +02:00
wood-galaxy 9b1fc9e705 Arch : Fix ViewProviderComponent if vobj have not DiffuseColor attribute
Comment PropertyPartShape in Equipement because it
doesn't work if base object is a solid.
2015-09-25 19:48:31 +02:00
wmayer f8d3210730 + fix build failure with gcc 2015-09-25 01:19:22 +02:00
wmayer e786cfbc90 + reimplement virtual methods in PropertyExpressionEngine 2015-09-25 00:52:44 +02:00
wmayer 1059ff14fc + register python type if its dict doesn't exist 2015-09-25 00:51:38 +02:00
wmayer 202b51171c + improve ply support 2015-09-24 23:19:33 +02:00
Przemo Firszt 8c38e25377 Materials: Fix BOM problem in FCMat files
BOM is byte order mark and it was crashing ConfigParser:

Traceback (most recent call last):
  File
"/home/przemo/software/FreeCAD/build/Mod/Fem/MechanicalMaterial.py",
line 109, in setEdit
    taskd = _MechanicalMaterialTaskPanel(self.Object)
  File
"/home/przemo/software/FreeCAD/build/Mod/Fem/MechanicalMaterial.py",
line 138, in __init__
    self.import_materials()
  File
"/home/przemo/software/FreeCAD/build/Mod/Fem/MechanicalMaterial.py",
line 264, in import_materials
    self.add_mat_dir(user_mat_dirname,
":/icons/preferences-general.svg")
  File
"/home/przemo/software/FreeCAD/build/Mod/Fem/MechanicalMaterial.py",
line 245, in add_mat_dir
    self.materials[a_path] = Material.importFCMat(a_path)
  File "/home/przemo/software/FreeCAD/build/Mod/Material/Material.py",
line 57, in importFCMat
    Config.read(fileName)
  File "/usr/lib64/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib64/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
<class 'ConfigParser.MissingSectionHeaderError'>: File contains no
section headers.
file: /home/przemo/.FreeCAD/Materials/AlMg3F24.FCMat, line: 1
'\xef\xbb\xbf; AlMg3F24 - 3.3535.26 - DIN 1725\n'

Reported-by: sgrogan
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-24 11:07:23 -03:00
wmayer 8257751ef7 + fix clang build failure 2015-09-24 13:14:23 +02:00
wmayer 29c8e82dae + fixes unicode support in expression engine 2015-09-24 13:10:54 +02:00
wmayer 12050b4c7d + use escaped unicode for mesh import 2015-09-24 10:10:22 +02:00
Eivind Kvedalen 89df605c3b Expression editor: Qt-workaround for '='-key; compare with text() instead. 2015-09-24 09:53:14 +02:00
Eivind Kvedalen 0894d5bdae ExpressionCompleter: Skip all types of links when building completer model. 2015-09-24 09:52:45 +02:00
wmayer 10786c65b8 + support of unicode names for sketch constraints 2015-09-24 03:17:47 +02:00
Bernd Hahnebach 8e8ecdd36f FEM: icons for FemShellThickness and FemBeamSection 2015-09-23 20:11:11 -03:00
Bernd Hahnebach 705c339f21 FEM: added object FemShellThickness and FemBeamSection to enable shell and beam analysises 2015-09-23 20:11:11 -03:00
Yorik van Havre de1bdefc7c Merge pull request #49 from pgilfernandez/pablogil-maya
New Maya navigation style
2015-09-23 20:05:05 -03:00
Yorik van Havre 2b172a9f41 Materials: Applied rockn's bugfix in material editor 2015-09-23 19:34:50 -03:00
Eivind Kvedalen 7b39e233e3 Expression parser: Fixed parsing of numbers like 2e3 (with e/E, but without decimal part). 2015-09-23 20:05:01 +02:00
Eivind Kvedalen 28fe9b481d QuantitySpinBox: Fixed placement of expression editor pop-up. 2015-09-23 18:48:22 +02:00
Priit Laes 90ccc1cee4 build: Remove unused SoQt cmake scripts 2015-09-23 12:25:43 +02:00
Priit Laes e891ec1ba2 build: Remove unneeded f2c cmake scripts 2015-09-23 12:25:43 +02:00
Priit Laes e4cf5fab49 build: Remove unneeded ODE configuration files 2015-09-23 12:25:42 +02:00
Przemo Firszt e544a66086 Travis: run FreeCAD and check log against .log_errors
All phrases that should trigger test build failure should be
added to .log_errors, one per line.

Tested-by: sgrogan
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-23 10:06:19 +02:00
Przemo Firszt f85352d93d FEM: Fix file names in MechanicalAnalysis.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
Przemo Firszt d29f3fa276 FEM: FemTools - add function documentation
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
Przemo Firszt 8cd0939fff FEM: Update inp_file_name after base_name or working_directory change
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
Przemo Firszt cee4fc688f FEM: Fix icon names
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
Przemo Firszt 9ce1020d84 FEM: Fix white spaces
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
Przemo Firszt ee7beea983 FEM: Fix file paths + tidy up naming
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-22 20:09:53 -03:00
wmayer 60062892a6 + backward compatibility of Linear and Polar pattern 2015-09-22 18:04:07 +02:00
wmayer b33be62bb6 + rename signal to signalRelabelObject and remove unused code 2015-09-22 17:13:03 +02:00
wmayer a8507628fa Fix warnings: -Wuninitialized in expression engine 2015-09-22 10:12:17 +02:00
Mateusz Skowroński 43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
Yorik van Havre 0ce3d46e92 Materias: Fixed small bug in material editor 2015-09-21 19:49:04 -03:00
wmayer 037ec5be78 + fix build failure 2015-09-21 23:42:18 +02:00
Przemo Firszt b25d2cd54d FEM: FemTest rework
- move test files to a separate directory
- use real life model to generate .inp files (model included)
- change format of csv node/volume files to allow direct copy&paste from .inp files
- use pre prepared real-life .dat & .frd files to test analysis results loading functions
- much more fine grained error reporting
- remove empty lines for output
- add helper function to print to console

Example run of the FEM test:

--------------- Start of FEM tests ---------------
Checking FEM new analysis...
Checking FEM new mesh...
sh: SMDS_MemoryLimit: command not found
Checking FEM new material...
Checking FEM new fixed constraint...
Checking FEM new force constraint...
Checking FEM new pressure constraint...
Checking FEM inp file prerequisites...
Checking FEM inp file write...
Setting up working directory /tmp/FEM_static
Writing /tmp/FEM_static/Mesh.inp for static analysis
Comparing /home/przemo/software/FreeCAD/build/Mod/Fem/test_files/cube_static.inp to /tmp/FEM_static/Mesh.inp
Setting up working directory to /home/przemo/software/FreeCAD/build/Mod/Fem/test_files in order to read simulated calculations
Setting base name to read test cube_static.frd file...
Checking FEM frd file read from static analysis...
Result object created as "Results"
Reading stats from result object for static analysis...
Setting analysis type to 'frequency"
Setting up working directory /tmp/FEM_frequency
Writing /tmp/FEM_frequency/Mesh.inp for frequency analysis
Comparing /home/przemo/software/FreeCAD/build/Mod/Fem/test_files/cube_frequency.inp to /tmp/FEM_frequency/Mesh.inp
Setting working directory to read simulated calculations...
Setting base name to read test cube_frequency.frd file...
Checking FEM frd file read from frequency analysis...
Last result object created as "Mode_10_results"
Reading stats from result object for frequency analysis...
--------------- End of FEM tests ---------------

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-21 11:16:03 -03:00
wmayer 14b15ac095 + get Label directly 2015-09-21 14:51:13 +02:00
wmayer b936514937 + fix build problems with MSVC and libpack 2015-09-21 14:51:12 +02:00
Eivind Kvedalen 4a3de89af0 Spreadsheet: Added round, trunc, ceil, and floor functions. 2015-09-21 14:51:12 +02:00
Eivind Kvedalen 310a684251 Spreadsheet: Added auto completer. 2015-09-21 14:51:11 +02:00
Eivind Kvedalen 4d5646fa5d Spreadsheet: Replaced own Expression classed by the ones in App. 2015-09-21 14:51:11 +02:00
Eivind Kvedalen 67800ec8c4 Sketcher: Added support for expressions. 2015-09-21 14:51:10 +02:00
Eivind Kvedalen cea2e62f57 Added QStyledItemDelegate to Qt4All.h 2015-09-21 14:51:09 +02:00
Eivind Kvedalen ddfbe349cf PartDesign: Added support for expressions. 2015-09-21 14:51:09 +02:00
Eivind Kvedalen 897f8b78b8 Added expression support to QuantitySpinBox and InputField classes. 2015-09-21 14:51:08 +02:00
Eivind Kvedalen 31a6fece52 Added ExpressionCompleter class. 2015-09-21 14:51:07 +02:00
Eivind Kvedalen d7cbdf6a31 Updated Document::exportGraphviz() to visualize expression dependencies. 2015-09-21 14:51:07 +02:00
Eivind Kvedalen a8328ec092 Modified Document::recompute() to take expressions into account. 2015-09-21 14:51:06 +02:00
Eivind Kvedalen fb2b1a6ec0 Added PropertyExpressionEngine to DocumentObject class. 2015-09-21 14:51:05 +02:00
Eivind Kvedalen 8259ec6764 Added PropertyExpressionEngine class. 2015-09-21 14:51:05 +02:00
Eivind Kvedalen b052c21b16 DocumentObject: Added getOldLabel() method, preparation for renaming of object identifiers. 2015-09-21 14:51:04 +02:00
Eivind Kvedalen 3f0fc98d72 Part: Added getPaths(...) method to PropertyPartShape. 2015-09-21 14:51:04 +02:00
Eivind Kvedalen ddc22a4101 Added setValue/getValue/canonicalPath/getPaths/verifyPath methods to various Property classes. 2015-09-21 14:51:03 +02:00
Eivind Kvedalen 722a40dd41 Added Expression classes to App directory. Added Expression interface to Property base class. 2015-09-21 14:51:02 +02:00
Eivind Kvedalen 3474419925 Spreadsheet: Updated documentation. 2015-09-21 14:51:02 +02:00
Eivind Kvedalen 4f589f6d60 Spreadsheet: Use Base::fromStdString/toStdString. 2015-09-21 14:51:01 +02:00
Eivind Kvedalen bee11897a1 Spreadsheet: Fixed bug with dangling pointer when a document object is deleted. 2015-09-21 14:51:01 +02:00
Eivind Kvedalen 4d1ebeccfa Base: Added toStdString and fromStdString, to convert std::string to/from QString,
assuming std::string is utf-8 encoded.
2015-09-21 14:51:00 +02:00
Eivind Kvedalen 61cbad8a12 Spreadsheet: Removed 'using namespace App'; preparation for moving Expression
classes to App.
2015-09-21 14:51:00 +02:00
Eivind Kvedalen 98700edbca Added Base::freecad_dynamic_cast(...) 2015-09-21 14:50:59 +02:00
Eivind Kvedalen f7625481a2 Spreadsheet: Made freecad_dynamic_cast calls unambiguous (preparation for next commit). 2015-09-21 14:50:58 +02:00
Eivind Kvedalen 2206e1cd7f Added -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment to mask warnings when compiling salomesmesh. 2015-09-21 14:50:58 +02:00
Yorik van Havre d3d7387da2 Arch: fixed bug in material dialog 2015-09-20 21:17:12 -03:00
wmayer ee59f1263c + if translation of group is done do not overwrite 2015-09-20 17:00:21 +02:00
wmayer 433efbc115 + fix possible crash in debug mode 2015-09-20 16:59:17 +02:00
wmayer cda9bf9ed5 + allow to set a default action for an exclusive group 2015-09-20 15:47:11 +02:00
wmayer ec91085765 + duplicate string array for Python commands 2015-09-20 14:11:53 +02:00
wmayer 1dad42c2f6 + fixes #0002126: Fails to load .FCStd file which contains many MultiByte-Char strings 2015-09-20 12:29:05 +02:00
wmayer bd105711d4 + delete helper file for copy/paste on application exit 2015-09-19 22:10:49 +02:00
wmayer b9a512361d + by default create a zip file for auto-save 2015-09-19 21:32:17 +02:00
wmayer 7d09444dd9 + fixes #0001237: the project file is not saved when the /tmp directory is full, but the user is not aware of it 2015-09-19 18:59:22 +02:00
wmayer bd1fc886fe + fix typo 2015-09-19 17:03:38 +02:00
wmayer 2991bbf033 + fixes #0001238: Preferences: set temp files directory 2015-09-19 16:07:33 +02:00
wmayer e5c3a09502 + for file-based recovery write the data files in worker threads 2015-09-19 13:12:59 +02:00
wmayer 848f9c4d46 + implement file based auto-save & recovery mechanism 2015-09-19 01:13:33 +02:00
wmayer 8db1280a4d + make RecoveryWriter more robust 2015-09-18 15:32:33 +02:00
wmayer bb05d17596 + implement FileWriter class based on files and a specialized sub-class for recovery purposes 2015-09-17 21:37:47 +02:00
wmayer 300e176eb3 + fixes #0002268: Segmentation Fault when using sketcher 2015-09-17 13:31:10 +02:00
wmayer 32367b1744 + save Brep in binary format for recovery files 2015-09-16 22:58:47 +02:00
wmayer 739e643f2f + check returned mdi view to be of the requested type 2015-09-16 16:15:19 +02:00
wmayer b9797ec92a + To avoid possible memory leaks or inconsistencies on Document::resetEdit() call finishEditing() of view provider inside document because the editing view could be closed already 2015-09-16 14:20:13 +02:00
wmayer 6dfc395a06 + fix method ViewProviderDocumentObject::getActiveView()
+ fix SoAutoZoomTranslation and SoZoomTranslation to get correct scaling factor
(do not rely on active view because this can be the wrong one and thus delivers wrong results)
2015-09-16 11:32:35 +02:00
wmayer 470b9ff756 + add convenience method to get editing view of a view provider 2015-09-15 22:09:28 +02:00
wmayer cbfdfd5c2e + proper Python exception handling in Gui.doCommand(Gui) 2015-09-15 18:36:15 +02:00
wmayer 5652ca2c61 + fix crash due to sloppy reference counting 2015-09-15 18:19:36 +02:00
wmayer fa1d43345a + fixes #0000870: Center sketch to a constraint that has been double clicked in the constraint list. 2015-09-15 17:24:23 +02:00
Bernd Hahnebach 75fbb93180 FEM: CalculiX writer comments regarding load calculation algorithm 2015-09-15 15:30:15 +02:00
Bernd Hahnebach 4f31fc44e6 FEM: ccxInpWriter formating according flake8 2015-09-15 15:13:30 +02:00
Bernd Hahnebach 04b6024e64 FEM: update FemAnalysis class description 2015-09-15 15:13:30 +02:00
Bernd Hahnebach c618962cd0 FEM: use more obvious method names in ccxInpWriter 2015-09-15 15:13:29 +02:00
Bernd Hahnebach 84e2b9ebbf FEM: make MechanicalMaterial less noisy 2015-09-15 15:13:29 +02:00
Bernd Hahnebach 40d35f23e4 FEM: fix typo in class type definition in MechanicalMaterial 2015-09-15 15:13:29 +02:00
Bernd Hahnebach fb9f43667d FEM: delete Debug prints in ccxInpWriter 2015-09-15 15:13:28 +02:00
Bernd Hahnebach 5a2940fb82 FEM: add to ccxInpWriter: CLOAD for shell meshes and solid meshes without face data 2015-09-15 15:13:28 +02:00
Bernd Hahnebach b553d9895d FEM: TestFem, use no space in materialname 2015-09-15 15:13:28 +02:00
Bernd Hahnebach c7ab1fd98b FEM: add FEM Mesh Type to the CalculiX elementset up to date only solid is supported 2015-09-15 15:13:27 +02:00
Bernd Hahnebach bab3ec689a FEM: CalculiX file writer move getTriangleArea to helpers 2015-09-15 15:13:27 +02:00
wmayer b28680f3d8 + fixes #0002150: [Ctrl]+[Z] is buffered in a non-intuitive way, does not function in 'edit mode' 2015-09-15 14:30:15 +02:00
wmayer 7dc59751cc + fixes #0002117: problems with rendering an arc - NAN 2015-09-15 12:53:22 +02:00
wmayer 2a569497b9 + fixes #0002118: Units conversion when using Imperial decimal (in/lb) 2015-09-15 11:30:11 +02:00
wmayer 29f827a575 + do not update item while editor is active 2015-09-15 00:30:28 +02:00
wmayer a7012575d4 + fixes #0002106: Add 'Default' option in Preferences 2015-09-15 00:12:40 +02:00
sgrogan 60cd098ae9 Remove Specific Weight from .FCMat files 2015-09-14 17:36:44 -03:00
sgrogan 2d1b79cbb0 Replace Specific Weight with Density 2015-09-14 17:36:44 -03:00
sgrogan 7d771c7a36 Make alternate material directory UserAppData/Materials 2015-09-14 17:36:44 -03:00
Yorik van Havre 163d206513 Updated ts files 2015-09-14 14:31:47 -03:00
Yorik van Havre 898d27e8d8 Updated ts & crowdin scripts with latest modules and languages 2015-09-14 14:31:27 -03:00
wmayer 718982cdcf + fixes #0002223: Units not displaying correctly 2015-09-14 15:57:35 +02:00
wmayer c135ca40a5 + fixes #0002222: Number of normals in exported VRML is wrong 2015-09-14 14:45:34 +02:00
wmayer 694c409caf + minor changes 2015-09-13 23:24:12 +02:00
wmayer b9865ed4f1 + fixes #0002209: Files that have a dot in name do not get the extension 2015-09-13 21:25:18 +02:00
wmayer d3281a66eb + fix whitespace, fix notification of changed property in view provider 2015-09-13 18:46:06 +02:00
wmayer 337a84328d + fixes #0002160: Customised keyboard shortcuts: D, U conflict 2015-09-13 18:29:21 +02:00
wmayer 9f5283d001 + fixes #0001941: Refresh Property Editor 2015-09-13 15:53:59 +02:00
wmayer 043dc1616d + fixes #0002197: Buggy Placement dialog when using Euler angles 2015-09-13 15:17:44 +02:00
wmayer 8cee8992ab Merge branch 'install' 2015-09-13 10:28:23 +02:00
Przemo Firszt 140272b9d3 Travis: Add sudo make install
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-12 20:22:21 +01:00
Yorik van Havre 216a747978 Draft: bumped minimum dxf lib to 1.39 2015-09-12 15:20:51 -03:00
Yorik van Havre ac84b8171e Draft: Added fix from Draft-dxf-importer issue 6 2015-09-12 14:32:50 -03:00
Yorik van Havre 83988ca831 Draft: Added wiki instructions URL to DXFimporter download fail message 2015-09-12 14:28:25 -03:00
wmayer 9fb882b103 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-09-12 12:41:56 +02:00
sgrogan 3274f42bb0 [PATCH] fix missing drawing vs fem 2015-09-12 12:41:31 +02:00
Jon Nordby e81c4cf62a Path: Basic .rml postprocessor for Roland Modela MDX
Jog, drill, linear and arc motions works.
Tested on machine with some trivial projects,
dimensions and feedrate speeds verified.

Safe-Z/clearance command currently not respected (defaults to max height, super conservative).
2015-09-11 18:54:19 -03:00
Yorik van Havre 7189c727bc Merge remote-tracking branch 'jonnor/path-cli-fixes' 2015-09-11 18:51:17 -03:00
wmayer 29b2c9ab6c + improve code style 2015-09-11 22:00:25 +02:00
Abdullah Tahiri 47c0859c1b Sketcher: Bug fixes: inability to create links to external geometry
=================================================================

First bug: Inability to create links to external geometry as described here:
http://forum.freecadweb.org/download/file.php?id=16668

Second bug: FC crashes on changing the support after having imported external geometry as described here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12380

and solving this ticket:
http://www.freecadweb.org/tracker/view.php?id=2225

Solution to first bug:

If for some reason a sketch ends up having a list of external geometries (property) that can not be recreated (rebuilt),
they remain latent, do not show the external elements in the elements widget or in the screen and prevent adding the
elements again.

In cases where the saved file contains invalid external geometry links (which will give raise to a handled exception that would prevent external geometry creation),
this condition gets detected during restore and the invalid links are deleted before external geometry creation, so as to allow the rest of external links to be recreated.

Solution to second bug:

It is also related to invalid external links (the link was existing, but upon change on the support, it is possible that an external edge is no longer valid, reduction of edges in support).
This situation is detected upon entering into edit mode, and the invalid ones are deleted.

Note that there is still the possibility for the user to remap an invalid sketch BEFORE editing, if the remapping is successful, it may not be necessary to delete links (all depends on the
specific case).
2015-09-11 21:25:58 +02:00
wmayer 185735ca2c + fixes #0002258: Silent uninstall blocks on MessageBox, fixes #0002056: Support silent (de)installation using NSIS 2015-09-11 19:43:20 +02:00
wmayer 4d776eb03f + fix warning in smesh headers 2015-09-11 18:52:26 +02:00
wmayer 731b2567b3 Mod/Sandbox: Remove -Wunused-result warnings. 2015-09-11 18:42:25 +02:00
wmayer 9da3580b3d WildMagic: Remove -Wunused-result warnings. 2015-09-11 18:20:49 +02:00
wmayer 5ef9039f5e zipios++: Remove -Wunused-result warnings. 2015-09-11 18:11:11 +02:00
wmayer 470880ebed Mod/Robot: Removed -Wreorder warnings. 2015-09-11 16:48:36 +02:00
wmayer 7f0c5b5f23 Mod/Robot: Removed -Wunused-variable warnings. 2015-09-11 16:14:17 +02:00
wmayer df4c99f157 Mod/Robot: Removed -Wsign-compare warnings. 2015-09-11 16:09:11 +02:00
wmayer 1f1660a860 Mod/Robot: Removed -Wunused-result warnings. 2015-09-11 15:45:21 +02:00
wmayer 98ab26ce12 Mod/Sketcher: Removed -Wreorder warnings. 2015-09-11 15:34:34 +02:00
Eivind Kvedalen b4ee6b9be6 Mod/Spreadsheet: Removed unused method. 2015-09-11 15:24:12 +02:00
Eivind Kvedalen e0f3ab2473 Mod/Spreadsheet: Removed -Wsign-compare warnings. 2015-09-11 15:23:37 +02:00
wmayer 4d9af51470 Mod/Path: Removed-Wuninitialized warnings. 2015-09-11 15:19:18 +02:00
Eivind Kvedalen 1f93879a0c Mod/Path: Removed -Wunused-but-set-variable warnings. 2015-09-11 15:16:02 +02:00
Eivind Kvedalen cbee95494e Mod/Path: Removed -Wunused-function warnings. 2015-09-11 15:13:58 +02:00
wmayer c05baee29a + fix warnings in Fem 2015-09-11 15:11:55 +02:00
Eivind Kvedalen 6d84d419c2 Mod/Fem: Removed -Wunused-variable warnings. 2015-09-11 14:52:32 +02:00
wmayer 99348d3a5b + fix cmake issue caused by patch 2015-09-11 14:47:47 +02:00
wmayer ec898944af + don't use hardcoded height in PropertyItemDelegate::sizeHint 2015-09-11 10:35:48 +02:00
Johannes Obermayr 9bceab911b Robot: Fix last -Wreturn-type warning.
Since getTypeName() returns None for None and default both must be handled the same way in other switches.

After applying following bug will be fixed:
http://www.freecadweb.org/tracker/view.php?id=2212
2015-09-11 07:18:07 +02:00
Johannes Obermayr 79ae0091ad libarea doesn't depend on parts from CMAKE_INSTALL_LIBDIR
Fixes:
 -- Installing: /home/abuild/rpmbuild/BUILDROOT/FreeCAD-0.15.99+git20150727.1925-1.1.x86_64/usr/lib64/FreeCAD/lib/area.so
 CMake Error at src/Mod/Path/libarea/cmake_install.cmake:53 (file):
   file RPATH_CHANGE could not write new RPATH:

     /usr/lib64/FreeCAD/lib

   to the file:

     /home/abuild/rpmbuild/BUILDROOT/FreeCAD-0.15.99+git20150727.1925-1.1.x86_64/usr/lib64/FreeCAD/lib/area.so

   No valid ELF RPATH or RUNPATH entry exists in the file;
2015-09-11 07:18:07 +02:00
Johannes Obermayr 2b9da837d7 Avoid build time on generated files from pyside-rcc and pyside-uic.
Fixes build compare:
[ 3218s] RPM file checksum differs.
[ 3218s] Extracting packages
[ 3232s] /usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py differs (Python script, ASCII text executable, with very long lines)
[ 3232s] --- old//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-21 20:26:34.000000000 +0000
[ 3232s] +++ new//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-23 11:41:24.000000000 +0000
[ 3232s] @@ -2,7 +2,7 @@
[ 3232s]
[ 3232s]  # Resource object code
[ 3232s]  #
[ 3232s] -# Created: Wed Jan 21 20:26:34 2015
[ 3232s] +# Created: Fri Jan 23 11:41:24 2015
[ 3232s]  #      by: The Resource Compiler for PySide (Qt v4.8.4)
[ 3232s]  #
[ 3232s]  # WARNING! All changes made in this file will be lost!
2015-09-11 07:18:07 +02:00
Przemo Firszt 7446930f69 FEM: Fix invalid update_displacement reset call
Reset parameter is not an option, empty parameters list call does the resetting.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-10 14:04:38 +01:00
Abdullah Tahiri 53320b260e Sketcher: Renaming old get Coincident functions and introducing a extended one
==============================================================================

What is this?

method

getCoincidentPoints

actually only included (as indicated in the documentation comment) those points coincident by a single constraint.

That is not "all the coincident points".

However some methods currently using it are expecting exactly that (coincident points linked by a single constraint).

A new method is introduced:
const std::map<int, Sketcher::PointPos> getAllCoincidentPoints(int GeoId, PointPos PosId);

that provides all the points coincident with the given one, directly (via a single constraint) or indirectly (via multiple coincident constraints).

The old method is renamed to:
getDirectlyCoincidentPoints

So as to have a more meaningful name to differentiate between both methods.
2015-09-09 22:57:49 +02:00
Abdullah Tahiri 82e41125da Sketcher bug/feature request: arePointsCoincident/coincidence creation
======================================================================

1. SketchObject::arePointsCoincident upgraded to check for indirect coincidence.
2. Coincidence constraint creation now checks for indirect coincidences and avoids
creating redundant coincidence constraints (for example during box selection).
2015-09-09 22:56:14 +02:00
Abdullah Tahiri 224b3ec7d7 Sketcher: Improvement: Horizontal/Vertical Autoconstraint creation with External Geometry
=====================================================================================

This fixes a bug related to:
http://www.freecadweb.org/tracker/view.php?id=2093

that during creation of a geometric element if a vertical/horiz autoconstraint is to be enforced, it is not enforced if the endpoints of the geometric element under creation are
coincident with external geometry.

According to the discussion here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12254&sid=eacf5bdee068cb71cc54dc5a62a6849d&start=20#p99359

this fixes the bug.

It does not fulfil the request on the ticket as it was decided to still allow an explicit addition of a vertical/horizontal constraint, as
it may be needed in some cases and the user expects to be able to add them, even if it will lead to an overconstrained sketch.

How to reproduce?
1. Create a rectange
2. Pad it
3. Create a new sketch on a face
4. link two corners as "external geometry" (but not the ones of a diagonal)
5. Create a line coincident with the first and second corners, so that the line is horizontal or vertical

In master it will force horiz or vert leading to a overconstrained sketch.
With this patch, the horiz/vert will not be enforced in this case.
2015-09-09 22:50:36 +02:00
wmayer 003199d6df + fix possible loss of data with recovery function, show auto-save message in status bar 2015-09-09 18:49:45 +02:00
Przemo Firszt 32c96b4267 Tests, FEM: Add test for frequency analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 12:17:12 -03:00
sgrogan 8cfc4b66be Remove Hardcoded Icons from Drawing and Mesh WB 2015-09-09 12:15:55 -03:00
Przemo Firszt 25b501e215 FEM: Add reset_all funcion to FemTools
reset_all groups purge_results, reset_mesh_color and reset_mesh_deformation

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:50 +02:00
Przemo Firszt 0ba28a5ba6 FEM: Add function documentation
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:49 +02:00
Przemo Firszt 89d795ff90 FEM: Add option to limit max value of result being used to color FEM mesh
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:48 +02:00
Przemo Firszt b516e35b19 FEM: Add frequency analysis to FEM wb
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:47 +02:00
Przemo Firszt 7bf1bcdec3 FEM: Add get_results_object function
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:46 +02:00
Przemo Firszt d52ad7e4bf FEM: Raise exception on use or load of non existing results
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:46 +02:00
Przemo Firszt 2f681ab928 Material: Add generic glass FCMat file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-09-09 13:57:45 +02:00
wmayer cff386e210 + easier way to change license and url of an existing document 2015-09-09 13:53:07 +02:00
Jon Nordby 685865ce31 Draft: Fix typos in circleFrom2PointsRadius()
Can't have been used in a while...
2015-09-08 21:19:43 +02:00
Jon Nordby 6f89398b07 Path: Allow PostUtils to be used in CLI mode 2015-09-08 21:19:43 +02:00
Jon Nordby b195afc8ca Path: Fix unable to import from CLI
Need to guard 'import FreeCADGui' in this case.
2015-09-08 21:18:31 +02:00
wmayer 3c10cd1af2 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-09-08 19:17:58 +02:00
wmayer bd94486c7e + fix inconsistencies between license note and url 2015-09-08 19:17:36 +02:00
Yorik van Havre c515004611 Draft: Further typos in DraftGeomUtils 2015-09-08 13:18:22 -03:00
Yorik van Havre 9972dfbec9 Draft: fixed typo in DraftGeomUtils 2015-09-08 12:41:49 -03:00
Yorik van Havre f1b21bf01d Added Tools/githubstats.py script to check download stats from github 2015-09-08 00:18:31 -03:00
Yorik van Havre 98e9dd08ac Preferences->Document->License URL field is now editable 2015-09-07 20:10:02 -03:00
Yorik van Havre 6b792952c3 Draft: Added preference setting to use the new C++ dxf importer 2015-09-07 16:46:08 -03:00
Mateusz Skowroński b4e3fcb428 Fix for bugs #2236 & #2237 2015-09-07 15:28:18 -03:00
Yorik van Havre 23b1ed5c79 Arch: Fixed imports in ArchRoof 2015-09-07 15:10:29 -03:00
wmayer 7f9aa7b4a5 + add method to write/read BREP in binary format 2015-09-07 19:02:56 +02:00
Yorik van Havre 3665b77827 Draft: Added a pref option to disable SVG page scaling on import - fixes #2062 2015-09-05 23:35:52 -03:00
wmayer 4da63d1d03 + fixes #0002238: Python: Environment Variable 'path' with mutated vowel 2015-09-05 14:52:06 +02:00
Yorik van Havre 220afa90db Extending doxygen stuff for Draft & Arch 2015-09-04 19:14:36 -03:00
Yorik van Havre bfad821cf2 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-09-04 19:14:04 -03:00
wmayer 134acba916 + fix switching to another mdi view when using the sketcher creation command from task panel 2015-09-04 21:34:26 +02:00
wmayer 568f2634fe + fix switching to another mdi view when using the sketcher creation command from task panel 2015-09-04 21:06:56 +02:00
Yorik van Havre 39035fc252 Draft: Prepared support for dimensions in new DXF importer 2015-09-04 16:05:32 -03:00
wmayer 1fa67d08d8 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-09-04 17:53:58 +02:00
wmayer 16f813281c + issue #0000175: Auto save function 2015-09-04 17:53:22 +02:00
Yorik van Havre fa550f0957 Arch: bigger default section plane - fixes #2189 2015-09-04 12:49:03 -03:00
Yorik van Havre 989a5fa933 Draft: fixed precision problem - fixes #1940 2015-09-04 12:43:09 -03:00
Yorik van Havre 91b2506ccc Changed all references to DraftGeomUtils.sortEdges to Part.__sortEdges__ 2015-09-04 11:54:57 -03:00
wmayer 9cb63295e9 + issue #0000175: Auto save function 2015-09-04 15:08:12 +02:00
wmayer 9253572afe + implement GUI to enable/disable auto-save and its timeout 2015-09-04 00:48:26 +02:00
wmayer a811a3bf03 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-09-03 19:09:33 +02:00
wmayer 60b555d64b + implement auto-save function for documents 2015-09-03 19:09:03 +02:00
Yorik van Havre 3dfc22231e Part.__sortEdges__ now reorients edges if needed 2015-09-03 11:17:46 -03:00
wmayer ada32f936a + allow to create a compound from a single part object 2015-09-03 13:19:21 +02:00
Yorik van Havre 60e63e12d6 Draft: Allow Clones to clone a group 2015-09-02 20:07:17 -03:00
wmayer 26b424e776 + support of exclusive Python command groups 2015-09-02 22:52:04 +02:00
Yorik van Havre a90fd14fe7 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-09-02 13:41:32 -03:00
Yorik van Havre da2c497671 Added SaveCopy command
This command saves a copy of the current document under a new name,
without modifying the document itself.

Available in menu File -> Save a Copy or from python with
FreeCAD.ActiveDocument.saveCopy(filename)
2015-09-02 13:38:14 -03:00
Yorik van Havre 0d9dc9414d Draft: fixed display mode of objects converted from sketches - fixes #2166 2015-09-02 13:37:00 -03:00
wmayer e461f65552 + fix build for FreeBSD 2015-09-02 18:06:37 +02:00
wmayer 49dfb24267 + Fix suffix for Korean 2015-09-02 18:06:14 +02:00
wmayer 890f1f10c3 + fix linking error in Sandbox module 2015-09-02 14:08:43 +02:00
Alexander Golubev 0603c3fb61 App/DocumentObserver: make slot methods unimplemented rather pure-virtual and clenup derived classes accordingly 2015-09-02 13:54:44 +02:00
Alexander Golubev 3f8350157a put -Wall flag before the user specified flags 2015-09-02 11:08:16 +02:00
wmayer 993a8a8583 + fix build failure in debug build type 2015-09-01 19:39:34 +02:00
wmayer 979d1299cc + fix various warnings with gcc 2015-09-01 19:29:39 +02:00
Yorik van Havre 9426a77690 Fixed crash when empty lines in App::Annotation - fixes #2016 2015-09-01 11:48:08 -03:00
Yorik van Havre d0e43137ce Draft: Fixed translation again 2015-09-01 10:50:23 -03:00
Yorik van Havre d38863538c Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-09-01 10:47:47 -03:00
Yorik van Havre 2aff34eab8 Draft/Arch: Used new PropertyVectorDistance where needed 2015-09-01 10:47:25 -03:00
Yorik van Havre 4daf44b925 Draft: Fixed small issue in translation 2015-09-01 10:46:21 -03:00
wmayer 3a4e93bb3d + implement method getPointNormals 2015-09-01 14:59:14 +02:00
wmayer 9846e52ed9 + fix flaws in class PropertyVectorDistance 2015-09-01 13:49:01 +02:00
wmayer 86a7ed44e0 + fix various warnings with VC++ 2015-09-01 12:50:10 +02:00
Yorik van Havre e19e7336cd Added new property type: App::PropertyVectorDistance
This works exactly as a normal PropertyVector, but it
uses the Units-enabled GUI editor instead.
2015-08-31 22:57:29 -03:00
Yorik van Havre 1ed0ec974a Arch: Fixed crash when loading old files 2015-08-31 18:17:29 -03:00
Abdullah Tahiri 650f3282d5 Sketcher: Rename of the "Defaults" button of the advanced solver dialog
=======================================================================

Just renaming the button and adding a tooltip as discussed here:
http://forum.freecadweb.org/viewtopic.php?f=8&t=12180&start=30#p98221
2015-08-31 13:58:12 +02:00
wmayer 3807cbdb23 + improve whitespaces 2015-08-31 13:53:48 +02:00
Abdullah Tahiri 27bace846e Part Design: Bug fix Sketcher tools Menu in Part Design Menu
============================================================

As per forum request:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11840&start=40#p97205

This actually was a bug of last year when I wanted to introduce it, coded it, but failed to actually make it shown.
2015-08-30 12:08:46 +02:00
Abdullah Tahiri 35b1b5bb04 Sketcher: SelectElementsAssociatedWithConstraints added to tools toolbar
========================================================================

By express request:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11840&start=40#p97202
2015-08-30 12:08:46 +02:00
Abdullah Tahiri 927fca0ece Sketcher: Bug fix addGeometry list creation and construction lines
==================================================================

A recent improvement was to allow to create an object (several geometric elements) as construction lines
by providing an additional parameter as true (that defaults to false).

This introduced a bug, that when a list of geometries mixing construction and normal lines was added (with the parameter as false),
construction lines would be converted to normal lines.

This fixes the bug.
2015-08-30 12:08:45 +02:00
Abdullah Tahiri 9583ce4c70 Sketcher: Clone Copy and Sketcher Mirror icons by Jim 2015-08-30 12:08:45 +02:00
Abdullah Tahiri d795eb2b7d Sketcher: New Functionality: Mirror full sketch
===============================================

Support for mirroring a full sketch.

A dialog appears allowing to select X, Y axis mirroring or mirroring about the origin of the sketch.
2015-08-30 12:08:44 +02:00
Abdullah Tahiri 0e01764f0b Sketcher: UI Copy/Clone as a single dropdown toolbar icon
=========================================================

This commit provides with a single toolbar button to select between a copy and clone.

Copy just copies the constraints.
Clone modifies the dimensional constraints to geometric constraints, so that the constrained geometry follows the changes in the original object.
2015-08-30 12:08:44 +02:00
Abdullah Tahiri 97d551b551 Sketcher: Extension of Copy/Array functionality to clone
=============================================================

This commit allows the user to select in advance whether he wants a simple copy or a clone.

This involves substitution of dimensional constraints in the copies by equality and parallel constraints.

Terminology change for Arrays, now it is Rectangular array
2015-08-30 12:08:43 +02:00
Abdullah Tahiri 6ea93a4a04 Sketcher: Symmetry/Copy/2DLinearArray art by Jim
SVG and XPM icons for copy and array creation by Jim
2015-08-30 12:08:42 +02:00
Abdullah Tahiri 6a16910ba5 Sketcher: UI Copy Support & 2D Array python command rework
==========================================================

- Support for copying geometric elements in the sketcher with Ctrl+C (or using the still missing icon). It will show you the vector of displacement from the
"reference point". The reference point can be chosen by the user (although it is not necessary to do it so) by making the point the user wish to be the reference point
the last selected element. It conveniently incorporates "autoconstraints", so that you can make this point (the one of the copy) directly coincident with any other point in the sketch.

- Python 2D array command modified to lock elements position using construction lines and constraints.
- Support for different spacing between u and v directions (the direction of the cols and the direction of the rows).

- Support to avoid copying DistanceX and DistanceY constraints when used for locking a point. This means that if the geometry that you copy(array) is
fully constraint, the resulting 2D array is also fully constraint.

- UI support for creating 2D linear arrays in the sketcher.
- Bug fix in python addArray, wrong line copy startingpoint calculation fixed.

How to create a 2D array in the sketcher:
1. Select your geometric elements.
2. Click the button
3. Fill in the rows/cols and preferences on spacing and constraining each element of the array
4. Click Ok
5. Define the direction of the cols of the array and click
2015-08-30 12:08:42 +02:00
Abdullah Tahiri ee43612125 Sketcher: AddSymmetric End-to-End point tangency bug fix
========================================================

For a while End-to-endpoint tangency is implemented via AngleViaPoint constraint. The code was not recalculating the "value" of the constraint in this case.

This also forces to set the geometry first and constraints afterwards, as the AutoLockTangencyAndPerpty function requires a valid GeoId to operate (not a big deal anyway).

Correction of the condition to allow the symmetry when a single line is mirrored about a point pertaining to a geometric element.
2015-08-30 12:08:41 +02:00
Abdullah Tahiri 3eb8f21116 Sketcher: New Features: Python copy and array commands
======================================================

Two new python commands (no UI yet).

Copy: Copies the geoids in a list by a displacement given by a Vector3d:

App.ActiveDocument.Sketch001.addCopy([0,1,2,3,4,5],App.Vector(150,150,0))

Array: Copies the geoids in a list cols times in the displacement vector
direction and rows times in the perpendicular to the displacement vector:

App.ActiveDocument.Sketch001.addArray([0,1,2,3,4,5], App.Vector(150,150,0),3,4)

N.B.: You need to recompute or solve to update the view

App.ActiveDocument.recompute()

or

App.ActiveDocument.Sketch001.solve()
2015-08-30 12:08:40 +02:00
Abdullah Tahiri 359e9a5d78 Sketcher: New Feature: Symmetric tool
=====================================

Creates geometry symmetric to the selected one with respect to the last selected point or line.

It does not support the following constraints:

- Angle
- Horiz/vertical distance
- SnellLaw

Horizontal and Vertical (directional) dimensions removed from the the copying process when created
on a single edge (by picking one edge instead of two points), i.e. Constraint involving only one GeoId at "First".
2015-08-30 12:08:40 +02:00
Abdullah Tahiri fbc6ed5c77 Sketcher: Bug fix: Wrong solver information upon failed solve
=============================================================

http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&start=80#p92820

...I already have a minor bug, if you insert a conflicting dimensional constraint,
the solver information is not updated, the work-around is to hit "Manual Update".
2015-08-30 12:08:39 +02:00
Przemo Firszt bade81ddcf Doc: Quarter doc main page is not FreeCAD documentation main page
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-30 11:59:21 +02:00
wmayer 32bcbda232 + fix various warnings 2015-08-30 11:48:26 +02:00
wmayer cac09437c8 + fix various warnings 2015-08-29 23:01:19 +02:00
wmayer 13fa571c41 + fix 'switch' warnings 2015-08-29 22:26:48 +02:00
wmayer f7eb1ef924 + fix various warnings 2015-08-29 22:12:33 +02:00
wmayer cb16fec6bb + fix various warnings 2015-08-29 22:05:09 +02:00
wmayer 1a12d109e9 + fix strict-aliasing warnings 2015-08-29 19:48:08 +02:00
wmayer 023de9b0f8 + fix author notice 2015-08-29 18:49:16 +02:00
Alexander Golubev 4fcbff9d34 Mod/Complete: suppress a minor warning
The warning was dedicated to using of char as an array index.
2015-08-29 18:36:04 +02:00
Alexander Golubev 2d6e82fb2c Mod/Robot: fix yet another warning (potentialy harmful)
Warning was -Woverloaded-virtual
2015-08-29 18:36:03 +02:00
Alexander Golubev d2176be234 Mod/Spreadsheet: fix yet another warning (potentialy harmful)
Warning was -Woverloaded-virtual
2015-08-29 18:36:02 +02:00
Alexander Golubev a8634f09fc 3rdParty/salomesmesh: suppress several small warnings
Warnings was about a struct declared as type and as usual added several
additional brackets.
2015-08-29 18:36:01 +02:00
Alexander Golubev c3dfc7e30c 3rdParty/salomesmesh: fix a couple error-prone warnings
The Warnings was about hiding bases class RemoveElement() and
RemoveFreeElement() virtual methodes which may caused calling wrong
function by bases class pointer.
2015-08-29 18:36:01 +02:00
Alexander Golubev cf652c8410 Mod/Mesh: suppress bunch of warnings on C++11 usage
Warnings was like:
src/Mod/Mesh/App/WildMagic4/Wm4Vector4.cpp|21 col 49| warning: first declaration of static data member specialization of 'ZERO' outside namespace 'Wm4' is a C++11 extension [-Wc++11-extensions]
2015-08-29 18:36:00 +02:00
Alexander Golubev de2f8a26b2 Mod/Spreadsheet: suppress warnings
Warnings was:
src/Mod/Spreadsheet/App/Expression.cpp|788 col 20| warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
2015-08-29 18:35:59 +02:00
Alexander Golubev bbbefaf188 Mod/Sketcher: suppress warning
Warning was:
src/Mod/Sketcher/Gui/CommandConstraints.cpp|1031 col 28| warning: '&&' within '||' [-Wlogical-op-parentheses]
2015-08-29 18:35:58 +02:00
Alexander Golubev cd9488daf7 Mod/Sketcher: add missing brackets in conditions
Warning was:
src/Mod/Sketcher/Gui/CommandConstraints.cpp|131 col 99| warning: '&&' within '||' [-Wlogical-op-parentheses]
2015-08-29 18:35:58 +02:00
Alexander Golubev 95f0decaa5 Mod/Robot: fix missing return statement
Warning was:
src/Mod/Robot/App/kdl_cp/chainjnttojacsolver.cpp|46 col 5| warning: control may reach end of non-void function [-Wreturn-type]
2015-08-29 18:35:57 +02:00
Alexander Golubev cd0ae20ef5 Mod/Robot: fix some spaces and a couple of warnings
Warnings wsa:
src/Mod/Robot/App/kdl_cp/chaindynparam.cpp|105 col 5| warning: control may reach end of non-void function [-Wreturn-type]
src/Mod/Robot/App/kdl_cp/chainidsolver_recursive_newton_euler.cpp|82 col 5| warning: control may reach end of non-void function [-Wreturn-type]
2015-08-29 18:35:56 +02:00
Alexander Golubev efb08237ac Mod/Robot: fix spacing and add a couple of FIXME's
It's to be considered to delete the class ChainIkSolverVel_pinv_nso:
it seems it's not used anythere and unmantained/unfinished for many years.
2015-08-29 18:35:55 +02:00
Alexander Golubev 4326c9657e Gui: fix constructor arguments due to prototype change
Warning message was:
src/Gui/DownloadManager.cpp|295 col 54| warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
2015-08-29 18:35:55 +02:00
Alexander Golubev 80941aa0e0 Gui & Mod/Sketcher: use fabs() instead abs()
Warnings was like:
src/Mod/Sketcher/Gui/DrawSketchHandler.cpp|350 col 28| warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
Also see:
http://forum.freecadweb.org/viewtopic.php?t=10920
http://forum.freecadweb.org/viewtopic.php?f=10&t=5258
2015-08-29 18:35:54 +02:00
Alexander Golubev 774dac17ac salomesmesh: suppress several warnings
Warning was like:
src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Mesh.cpp|1028 col 5| warning: add explicit braces to avoid dangling else [-Wdangling-else]
src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp|7377 col 27| warning: '&&' within '||' [-Wlogical-op-parentheses]
2015-08-29 18:35:53 +02:00
Alexander Golubev b714b8f4ad salomsmesh: fix more bad conditions
warning was:
src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Penta_3D.cpp|832 col 9| warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
2015-08-29 18:35:52 +02:00
Alexander Golubev a48d05e2bf salomesmesh: fix an error because of bad priorities in logial operators 2015-08-29 18:35:52 +02:00
Alexander Golubev 75ce52f6b8 salomesmesh: fix broken conditions
Warnings was:
src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp|617 col 19| warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
||   bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
||                   ^                 ~~
src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp|2165 col 31| warning: '&&' within '||' [-Wlogical-op-parentheses]
||       if ( !aMinStr.IsEmpty() && !aMinStr.IsIntegerValue() ||
2015-08-29 18:35:51 +02:00
Alexander Golubev 09c7179389 salomesmesh: fix function missing return statement
3rdParty/salomesmesh/src/SMESHDS/SMESHDS_GroupOnGeom.cpp|95 col 3| warning: control may reach end of non-void function [-Wreturn-type]
||   }
2015-08-29 18:35:50 +02:00
Alexander Golubev 5aa4679847 salomesmesh: fix tests in conditions
Lots of warnings like:
src/3rdParty/salomesmesh/src/SMESHDS/SMESHDS_Command.cpp|57 col 6| warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
||         if (!myType == SMESHDS_AddNode)
||

Most of them resulted in conditions being always false.
2015-08-29 18:35:50 +02:00
Alexander Golubev f5cd28fc53 Pivy: suppress warning
Warning was:
src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp|2303 col 31| warning:
'&&' within '||' [-Wlogical-op-parentheses]
||       !hasConstructionFaces() && elem->GetType() == SMDSAbs_Face ||
||       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-08-29 18:35:49 +02:00
Alexander Golubev 4b992c27bb Pivy: fix several warnings
Warnings like:
    warning: array index 2 is past the end of the array (which contains 2 elements) [-Warray-bounds]

All was due to small defined size of the onstack array.
2015-08-29 18:35:48 +02:00
Alexander Golubev 554d8f4078 Pivy: Fix a compiller warning with wrong check
Warning was:
src/3rdParty/Pivy-0.5/coin_wrap.cpp|244969 col 15| warning: comparison of function 'time' not equal to a null pointer is always true [-Wtautological-pointer-compare]
||           if (time != NULL) {
||               ^~~~    ~~~~

This one supposed to be a copy-paste typo.
2015-08-29 18:35:46 +02:00
wmayer 6a18530a8d + if FreeCAD is not running in Gui mode do not replace Python std. output 2015-08-29 17:22:40 +02:00
wmayer c3656ad646 + replace assert() to avoid crash 2015-08-29 16:34:36 +02:00
Yorik van Havre f70d5be2b7 Arch: Fixed DAE export - fixes #2219 2015-08-28 17:46:52 -03:00
Przemo Firszt daa024cc79 Material: Add missing Density fields using Tools
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:59:02 +01:00
Przemo Firszt fdb782c5c7 Materials: Add Materials.ods file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:59:02 +01:00
Przemo Firszt 729c1b4a73 Materials: Add Tools for FCMat<->ods conversion
Testing and proofreading by sgrogan

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:58:51 +01:00
Przemo Firszt 285ad9dbfa Materials: Update Readme.txt
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:58:31 +01:00
Przemo Firszt 84a88c4d2f Material: Add TEMPLATE.FCMat file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:58:31 +01:00
Przemo Firszt d2c7366f9a Material: Clean material files
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-27 15:58:31 +01:00
wmayer 8ec1bab139 + fixes #0002229: some ttf fonts make Draft.makeShapeString crash 2015-08-26 22:56:37 +02:00
wmayer a801fb20b8 + disable SVG and IDTF export for 3d view 2015-08-26 22:11:53 +02:00
wmayer 99fc24ea07 + fixes #0002221 2015-08-26 19:24:00 +02:00
wmayer 84a65a53ef + remove method View3DInventor::dumpSelection 2015-08-26 18:58:59 +02:00
wmayer 04cb2d4411 + code refactoring for VRML and Inventor export 2015-08-26 18:55:14 +02:00
wmayer a7a1edbc64 + restore old axonometric behaviour 2015-08-26 13:44:01 +02:00
Yorik van Havre d13179b63f Arch: IFC exporter now exports cloned Arch objects with shared geometry 2015-08-25 22:11:40 -03:00
wmayer 27dc80c846 + support of checkable commands 2015-08-25 18:01:37 +02:00
wmayer 1e745a6a6f + improve formatting 2015-08-25 15:11:42 +02:00
Yorik van Havre 70550739b6 Arch: IFC importer now treats objects with shared shapes as clones 2015-08-21 11:42:42 -03:00
wmayer 60707fc256 + algorithm to split a segment from the mesh 2015-08-20 08:49:22 +02:00
Przemo Firszt 15d7369de8 FEM: Force consistent DENSITY formatting
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-18 13:44:28 +01:00
Przemo Firszt 5e3dc0c2c9 Tests, FEM: Fix inp file writing test
It's a compare line-by-line without comment lines now instead of
previously used md5 sum comparison.

inp pre filtering method suggested by Far-Zer
File location fixes by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-18 13:44:28 +01:00
Yorik van Havre 53eb0dd758 Arch: Minor fix in OBJ exporter - fixes #2216 2015-08-17 20:27:19 -03:00
Yorik van Havre 0b44729bbe Draft: Small fix in copying dimensions and texts (didn't take the original style) 2015-08-17 11:50:02 -03:00
Yorik van Havre 6d1cb3c97a Draft: Small fixes in the new DXF importer 2015-08-17 11:48:02 -03:00
Bernd Hahnebach 0c82efe57a Arch: fix in import structural analysis ifc 2015-08-14 18:14:30 -03:00
Yorik van Havre 62c0a19071 Added preferences setting for default App::Annotation color 2015-08-13 23:12:00 -03:00
Yorik van Havre c733370cee Adapted cmake files for changes made in previous commit 2015-08-13 16:08:23 -03:00
Yorik van Havre 617088284c Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-08-13 15:55:43 -03:00
Yorik van Havre f64678a7ee Removed old StartPage files (cf debian bug #726805) 2015-08-13 15:55:21 -03:00
wmayer 4dee0663c3 + test command to show race conditions in Console class
+ fix race conditions in Console class
2015-08-13 18:57:52 +02:00
Yorik van Havre 9d10f3e026 Draft: Added text support to new DXF importer - issue #2205 2015-08-13 10:06:43 -03:00
wmayer 790714712a + avoid slow heap checking in debug mode when loading a mesh file 2015-08-12 17:51:22 +02:00
wmayer ab8d8a04ad + check for null pointer when trying to get associated view provider of a document object 2015-08-12 17:44:29 +02:00
wmayer c79662e35b + fix include dirs for DraftUtils 2015-08-12 17:34:09 +02:00
Yorik van Havre 51cff8f0c3 Draft: Added blocks support to the new dxf importer #2205 2015-08-12 10:23:55 -03:00
Bernd Hahnebach 73808aa15d Arch: remove trailling white spaces 2015-08-11 20:55:16 +02:00
Bernd Hahnebach 4dc09efd0d Arch: added object types to struct ifc import 2015-08-11 11:05:16 -03:00
Bernd Hahnebach aec3ab60cb Arch: add options to import structural engineering ifc 2015-08-11 11:05:16 -03:00
Yorik van Havre d5f80ff61c Draft: Starting a C++ DXF importer - issue #2205 2015-08-10 19:55:59 -03:00
Yorik van Havre 4f6a50ac27 Fixed git link in readme 2015-08-06 11:11:04 -03:00
Yorik van Havre 7fd2157ab0 Nicer readme file with screenshot 2015-08-06 11:08:26 -03:00
wmayer 13bf1a9cf5 + make FEM unittest more platform independent 2015-08-05 11:31:14 +02:00
Przemo Firszt f395f38d09 Tests, FEM: Add missing Density and update md5 of standard inp file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-08-05 11:02:37 +02:00
Przemo Firszt 95a7083267 Gui: add missing X11 lib
Code by wmayer
2015-08-05 11:02:36 +02:00
Yorik van Havre 192dca36c5 Draft: small bugfix - fixes #2159 2015-08-04 23:58:46 -03:00
Yorik van Havre 8c222a8c51 Draft: small bugfix - issue #2162 2015-08-04 23:50:33 -03:00
Yorik van Havre 2bc0826c77 Arch: Reintroduced support for custom subvolumes for windows 2015-08-04 22:18:30 -03:00
wmayer 76c0f55ebe + make mesh merge more performant 2015-08-04 11:32:52 +02:00
Yorik van Havre b4ea012edc Mesh: Added Mesh Merge command
This command joins selected mesh objects into one
2015-08-03 15:46:30 -03:00
Yorik van Havre cfbcd3a6f3 Arch: Encoding fix in DAE importer 2015-08-03 15:45:47 -03:00
wmayer 617bd8c859 + re-insert removed line 2015-08-03 10:53:36 +02:00
wwmayer e7441149f0 + fix many minor warnings, activate -Wall for gcc 2015-08-02 22:32:18 +02:00
wmayer 92a65a8b5b + remove option to build deprecated cam module 2015-08-01 10:47:46 +02:00
Przemo Firszt bc442592d2 Tests, Units: Add Density test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:14 -03:00
Przemo Firszt f808f03302 Tests, Units: Fix formatting
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:14 -03:00
Przemo Firszt 7d8fb99cea Units: Add Density to internal schema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:14 -03:00
Przemo Firszt d380187ef3 FEM, Material: Add DENSITY to inp files and basic material files
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:14 -03:00
Przemo Firszt b85c4430bd FEM: Fix invalid stdout/stderr variable names
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-31 14:04:13 -03:00
Yorik van Havre 2475be5fa1 Arch: more fixes in IFC importer 2015-07-31 12:56:13 -03:00
wwmayer 9196591803 + write message to start make 2015-07-31 01:27:48 +02:00
wwmayer 8da4f1dd1d + fixes #0001322 2015-07-31 00:37:05 +02:00
wwmayer 059bbdc496 + write more informative error messages for missing libraries 2015-07-30 23:22:44 +02:00
Yorik van Havre 5ae28eb038 Arch: small bugfix in IFC importer 2015-07-30 11:53:57 -03:00
Yorik van Havre 686f2adc58 Draft: small cosmetic fix to DXF importer 2015-07-30 11:53:18 -03:00
wmayer d71d8943cb + handle single quote when writing XML 2015-07-30 11:52:50 +02:00
Przemo Firszt d371cff4f2 FEM: Rename Fem_Quick_Analysis icon to fem-quick-analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt b5c08388b8 FEM: Rename Fem_Result icon to fem-result
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 35f506d369 FEM: Rename Fem_Purge_Results icon to fem-purge-results
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 4c813656ea FEM: Rename Fem_NewAnalysis icon to fem-new-analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 2a3409b4a6 FEM: Rename Fem_Material icon to fem-material
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt facb110329 FEM: Rename Fem_Inp_Editor icon to fem-inp-editor
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 6ca8a12525 FEM: Rename Fem_FemMesh_createnodebypoly icon to fem-fem-mesh-create-node-by-poly
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt bb1a41f15e FEM: Rename Fem_FemMesh icon to fem-fem-mesh-from-shape
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt c9c28a8690 FEM: Rename Fem_ConstraintPulley icon to fem-constraint-pulley
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt dc35235863 FEM: Rename Fem_ConstraintPressure icon to fem-constraint-pressure
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 1d766e9677 FEM: Rename Fem_ConstraintGear icon to fem-constraint-gear
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 5674ca802e FEM: Rename Fem_ConstraintForce icon to fem-constraint-force
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 93b24a1ab7 FEM: Rename Fem_ConstraintFixed icon to fem-constraint-fixed
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:34 -03:00
Przemo Firszt 505b4ba8d3 FEM: Rename Fem_ConstraintBearing icon to fem-constraint-bearing
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt 7a71e14a78 FEM: Rename Fem_Analysis icon to fem-analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt 337881348c FEM: Rename Fem_AddPart icon to fem-add-part
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt b88706bcd4 FEM: Rename Fem_AddMaterial icon to fem-add-material
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt f3d82fd9fa FEM: Rename Fem_AddFemMesh icon to fem-add-fem-mesh
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt 1d0d6dfe07 FEM: Tidy up icons ResultDisplacement, ResultStress and Result
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 11:00:33 -03:00
Przemo Firszt 5f4f6047e3 Tests, FEM: Add inp file writing test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 10:58:19 -03:00
Przemo Firszt b9676cf7ee FEM: Prepare ccxInpWriter for automated tests
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 10:58:19 -03:00
Przemo Firszt 461e506c41 FEM: Add command only when GUI is up
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 10:58:19 -03:00
Przemo Firszt 1de29d0ffa Test, FEM: Refactor existing tests as preparation for full analysis test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-29 10:58:19 -03:00
Yorik van Havre 8d4510fd29 Arch: further encoding fixes in IFC importer 2015-07-29 10:47:49 -03:00
Yorik van Havre 2515a69626 Arch: always use utf8 encoding when using ifcopenshell 2015-07-28 20:53:11 -03:00
wmayer ae7a53f4c1 + cmake policy CMP0054 2015-07-28 17:30:00 +02:00
wmayer 4cf84fe9d2 + update template module 2015-07-28 15:07:27 +02:00
wmayer b81482d597 + harmonize Coin3D cmake variables with official check 2015-07-28 14:55:15 +02:00
wmayer 7d98705396 + harmonize XercesC cmake variables with official check 2015-07-28 14:17:49 +02:00
wmayer 953ff71e99 + fix linking error on area module with clbundler 2015-07-28 11:44:37 +02:00
Przemo Firszt cc7fa5b28c Test, FEM: Add pressure constraint test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 16:25:01 -03:00
Przemo Firszt 3ef54f66bb Test, FEM: Add force constraint test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 16:25:01 -03:00
Przemo Firszt 32ebdf8e6f Test, FEM: Add fixed constraint test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 16:25:01 -03:00
Yorik van Havre e80fc80be3 Arch: search for movable children in groups too 2015-07-27 16:18:48 -03:00
Przemo Firszt 89b609ea8d Tests: build with -j2
Suggested & tested by saso
2015-07-27 14:03:44 +01:00
Przemo Firszt 0bfe92e83e Test, FEM: Add mesh test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
Przemo Firszt 632a554802 Test, FEM: Add new analysis test
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
Przemo Firszt 14c36da81d Test: Fix formatting in TestApp.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
Przemo Firszt 472b4943ce FEM: Remove no longer relevant comment. QuickAnalysis solved the problem
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
Przemo Firszt a9b28e541b FEM: No need to have ViewObject in _ViewProviderFemAnalysis init
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
Przemo Firszt f5ad8ca415 FEM: Don't import FemGui when it's not required
This is part of preparation to create automated FEM wb tests

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-27 14:03:44 +01:00
wmayer ddac5eed60 + fix crash in MeshCurvature::ComputePerVertex for empty meshes 2015-07-27 12:17:16 +02:00
wmayer 51f0e99d7b + use nodefaultlib linker flag for modules 2015-07-27 11:52:19 +02:00
wmayer d95003e92c + replace deprecated PYTHON_INCLUDE_PATH 2015-07-25 18:29:42 +02:00
wmayer 7c517e7620 + change axonometric view 2015-07-25 17:51:18 +02:00
wmayer 4319548f08 + fix typo in 'axonometric' 2015-07-25 16:54:18 +02:00
wmayer b5475db2de + create MODULE libraries in given directory 2015-07-24 22:56:18 +02:00
wmayer 2bbbeaafd2 + make area build with LibPack 2015-07-24 19:23:06 +02:00
wmayer b045896ce2 Merge branch 'master' of https://github.com/FreeCAD/FreeCAD 2015-07-24 16:45:31 +02:00
Przemo Firszt 6bd0501e53 CI: Add libboost-python-dev
Latest travis build failed at cmake stage:

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1202 (message):

  Unable to find the requested Boost libraries.

  Boost version: 1.46.1

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_python

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the

  directory containing Boost libraries or BOOST_ROOT to the location of

  Boost.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-24 10:00:50 +01:00
Yorik van Havre cad1db484b Path: fixed clang warnings in libarea 2015-07-23 23:28:33 -03:00
Dan Falck 6d4bd04c9b changed the way points are compared for equality 2015-07-23 23:17:15 -03:00
Dan Falck 56fad0cceb cleaned up area cmake again 2015-07-23 23:17:15 -03:00
Dan Falck 98a32d7982 added BSD license, removed shared lib for C++ 2015-07-23 23:17:15 -03:00
Dan Falck a6bb9a5e80 added CMakeLists for libarea 2015-07-23 23:17:15 -03:00
Dan Falck afd2f27bdc somehow I forgot to add this earlier 2015-07-23 23:17:15 -03:00
Dan Falck 0d5aee2f62 removed dxf related files and code that used them 2015-07-23 23:17:15 -03:00
Dan Falck 797a6f1ddb initial add of libarea files 2015-07-23 23:17:15 -03:00
Przemo Firszt f52401715d CI: Remove building on master only
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-23 15:47:29 +01:00
Przemo Firszt e742d473a6 CI: Add a test to .travis.yml
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-23 10:52:06 -03:00
Przemo Firszt 15bcb20d44 Typu in .travis.yml
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-23 10:52:06 -03:00
Yorik van Havre 34f1450cbd Arch: Fixed encoding in filenames 2015-07-22 17:51:55 -03:00
Przemo Firszt dff298c5b0 CI: Add initial .travis.yml file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-22 15:07:11 +01:00
wmayer de636242b3 Merge branch 'master' of git://github.com/FreeCAD/FreeCAD 2015-07-21 00:05:57 +02:00
Yorik van Havre fcefdc0a8d Draft: small fix in DXF importer 2015-07-20 10:27:25 -03:00
Sebastian Hoogen 519d93fa4f remove sourceforge git url 2015-07-19 20:27:04 +02:00
Yorik van Havre c2bedaeb96 Arch: small fix in windows - fixes #2193 2015-07-19 12:10:46 -03:00
Pablo Gil 18c63c1ee4 + improved comments 2015-07-19 11:27:20 +02:00
Pablo Gil 9e9cbfb1a7 + Maya navigation style 2015-07-18 19:33:05 +02:00
wmayer 36249a64ce + use variables instead of hard-coded library names 2015-07-17 14:54:02 +02:00
wmayer 1b58ec8bb7 + simplify dependencies in CMakeLists.txt files 2015-07-17 12:18:44 +02:00
wmayer 74e397c869 + eliminate cmake variable QT_QTCORE_LIBRARY_DEBUG 2015-07-17 11:33:49 +02:00
wmayer bb9f43746f + eliminate cmake variable Boost_DEBUG_LIBRARIES 2015-07-17 11:05:25 +02:00
wmayer 40cd060c5b + replace PYTHON_LIBRARY with correct variable PYTHON_LIBRARIES 2015-07-16 19:29:56 +02:00
wmayer 0b1da87302 + eliminate cmake variable QT_DEBUG_LIBRARIES 2015-07-16 19:06:20 +02:00
wmayer 6b3d7b17a7 + implement onDelete for Python proxy of view provider 2015-07-16 16:13:39 +02:00
wmayer 3241b1ece1 + Support preference pages for Python widget class 2015-07-16 00:10:23 +02:00
wmayer 62c6a61b8b + fix cmake variables related to debug/release libraries of Qt 2015-07-15 13:33:31 +02:00
Przemo Firszt ea0cc96c15 3rdParty: Remove boost-numeric, ANN and atlas
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-15 10:27:54 +01:00
wmayer 945638c405 Path: Fix a further warning 2015-07-14 19:12:46 +02:00
wmayer e6621ea78c Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-07-14 19:05:39 +02:00
wmayer 3a00aa5918 + fix wrong vertical size policy of task groups 2015-07-14 19:05:12 +02:00
Yorik van Havre 9b476e140d Path: Several fixes suggested by wmayer 2015-07-14 12:23:40 -03:00
wmayer 44ae0d7ae7 + fix mesh smoothing panel 2015-07-14 17:02:38 +02:00
wmayer 2ce0fac098 + set a minimalistic style sheet on task panel 2015-07-14 16:27:49 +02:00
wmayer 5273c47c1b + fix layouting problem due to bad implementation of minimumSizeHint() in ActionPanel and ActionGroup 2015-07-14 14:22:00 +02:00
sgrogan 4d2e81796d [PATCH] Fix dependency on QtCored4 and icons 2015-07-13 10:52:02 +02:00
wmayer a369791665 + issue #0002053: Support of themes 2015-07-12 23:59:26 +02:00
wmayer a5619f3bb6 + issue #0002053: Support of themes 2015-07-12 23:12:05 +02:00
wmayer f7644fc9f3 + issue #0002053: Support of themes 2015-07-12 22:54:56 +02:00
sgrogan b52ab25322 + by default disable bundled pivy and enable use of FreeType on all OS 2015-07-12 15:59:09 +02:00
wmayer 18f0ec61eb + fix crash in ViewProviderFemMesh::setHighlightNodes when values out of range 2015-07-12 10:47:57 +02:00
wmayer 2f25170763 + write out product name if defined to IGES/STEP files 2015-07-11 14:05:47 +02:00
wmayer 7bd6dccac7 + support user template parameter file for branding 2015-07-11 12:46:55 +02:00
wmayer 66de19b162 + improve loading splash screen of branded application 2015-07-11 02:59:56 +02:00
wmayer d6d9264f25 + fix possible crash when application icon is empty 2015-07-11 01:12:52 +02:00
wmayer b3970f63ba + implement missing types in FemMesh.addFace 2015-07-10 11:01:17 +02:00
wmayer af793f16b0 + event to restore/clear action style scheme 2015-07-09 23:08:10 +02:00
wmayer 82a4eb0cec + apply Debian patch: unittest to stdout 2015-07-09 15:29:45 +02:00
wmayer 18a770f616 + Fix crash when passing emtpy argument list to Path.Tooltable 2015-07-09 13:14:11 +02:00
wmayer ce5ce0f933 + implement SystemPanelScheme and use for Linux 2015-07-09 12:12:51 +02:00
wmayer 5fc3370235 + fix possible inconsistency of arrow button in task header 2015-07-08 22:23:24 +02:00
wmayer 1eb76ba48c + support dynamic property 'fold' in TaskHeader 2015-07-08 20:22:21 +02:00
wmayer 5b3d50afc4 + use icon of style sheet for task header
+ fix size issue with task panel
+ enable QSint task panel
2015-07-08 15:17:49 +02:00
wmayer df04df01f7 + add QSint test widget 2015-07-07 17:43:23 +02:00
wmayer 7b37841fdc + reset built-in scheme when setting global style sheet 2015-07-07 12:35:48 +02:00
wmayer 997001bbd9 + usage of QSint 2015-07-07 12:34:20 +02:00
wmayer b738537452 + add QSint scheme for FreeCAD 2015-07-07 11:45:57 +02:00
wmayer 61db2cb15e + extend QSint API, fix problems with Qt macro 2015-07-07 11:42:24 +02:00
wmayer 83bef31698 + add QSint source to build 2015-07-07 11:41:20 +02:00
wmayer bf97878f37 set export macro for QSint 2015-07-07 11:33:21 +02:00
wmayer 36241de2c6 + remove test class TaskPanelView 2015-07-07 11:25:31 +02:00
wmayer 3299e0c377 + add license notice 2015-07-07 11:10:54 +02:00
wmayer f71f962f54 + Add QSint sources 2015-07-07 11:10:13 +02:00
wmayer cc281d482e + move branding stuff from main() to FreeCADApp 2015-07-07 00:52:13 +02:00
Przemo Firszt 1470a32533 FEM: suppress some non error console messages
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:52 +02:00
Przemo Firszt bf1accec06 FEM: get noisy if ccx produces something in stderr
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:51 +02:00
Przemo Firszt f6bf3f3055 FEM: show ccx exit code if the code is not 0
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:51 +02:00
Przemo Firszt c87c15946c FEM: raise exception is no analysis is specified or found in __init__
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:50 +02:00
Przemo Firszt 9a7151863c FEM: reset results_present on purge_results
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:49 +02:00
Przemo Firszt 3d94464ba4 FEM: add use_results to allow selecting results by name
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:49 +02:00
Przemo Firszt e850604cdf FEM: Rename set_result_type to show_result
show_result by default shows Von Mises strass

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:48 +02:00
Przemo Firszt 52c453bdba FEM: add show_displacement to FemTools
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:47 +02:00
Przemo Firszt ff742beb97 FEM: Add multi-thread calcs
Slightly modified code by kwahoo
2015-07-06 19:21:46 +02:00
Przemo Firszt b45190fb4d FEM: Add Quick Analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:46 +02:00
Przemo Firszt 7f9e50a22b FEM: Allow to run inp writing/ccx in separate thread
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:45 +02:00
Przemo Firszt 4c4e76aa2b FEM: Use check_prerequisites from FemTools
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:44 +02:00
Przemo Firszt 3187141dfe FEM: move writing inp file to FemTools module
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:44 +02:00
Przemo Firszt e0956f67f3 FEM: Add basic FemTools module
That module will handle in the future all non-gui related features
that are currently in MechanicalAnalysis.py. It will allow easier
python scripting and greater flexibility when creating new FEM wb
features.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:43 +02:00
Przemo Firszt 2abdcf3b57 FEM: Move check_prerequisites to helpers section
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:42 +02:00
Przemo Firszt 5816bf1871 FEM: Move prepare_analysis_objects out of _JobControlTaskPanel class
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:41 +02:00
Przemo Firszt 81ff338236 FEM: Rename object to analysis_object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:41 +02:00
Przemo Firszt d250dc0425 FEM: Remove no longer used tempfile import
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:40 +02:00
Przemo Firszt c8436a94d6 FEM: Fix and activate setting working directory for Calculix
Also add FEM preferences option to define working ccx directory

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:39 +02:00
Przemo Firszt 99d07fbd9a FEM: rename obj to move descriptive analysis_obj
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:39 +02:00
Przemo Firszt 28b0a8bb77 FEM: Split prepare_analysis_objects from check_prerequisites
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:38 +02:00
Przemo Firszt 67714c5025 FEM: Temporary dir is only used by ccxInpWriter, so move it there
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:37 +02:00
Przemo Firszt f83520b2cc FEM: Remove out of date comments
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-07-06 19:21:37 +02:00
Yorik van Havre 3f4e55a474 Initial merge of Path module branch
authors: Yorik van Havre, Dan Falck, Brad Collette, Frederik Johansson, Dmitry Platonov,

eb4fd6c Path: moved colors preferences page to Path group
f4e5d70 a little more work on auto tool change
99a6e2f tied tool numbers in ops to last loaded tool
2d6fcda no need to select object for tooltable edit
b53eb15 Path: Fixed path bug #10 - Tooltableeditor
d6e996f Path: Fixed path bug #36 - Finish editing
16fe598 Path: Fixed path bug #37: labels in compound dialog
22dc594 Bugfix in pocket, was producing strange arcs due to a rounding error Path doesnt render values such as:-4.4408920985e-16 produced by python
9aae1d5 Make Gcode editor restore its size and position from last opened
b44e1d6 Move addToProject to PathUtils
71b727a Make all tools show its correct icon in the tree
86b32e0 Further simplify the code and fix issue in PathHop
e63b6b7 Simplify code and make automatic project creation more consistent across tools
261bfa3 Add ability to have external orocos-kdl library instead of the suplied in FreeCAD, used in Robot and Path workbenches
95efa27 Drilling-rapid to first location before moving Z
73537d6 I forgot to parse the SubObjects of the selection
044c23d improvements to drilling selection and properties
347fe62 small improvement to PathKurveUtils sorting
95ffe39 formatting
1003968 split full circles
27b19c2 added basic feedrate to PathKurveUtils
372ef57 Path: removed Path_rc and DemoParts from Cmake
98705ad using toBiarcs for paths based on splines
32663e5 slight startpt/endpt simplification
fd8f258 parametric start and end pts to PathKurve
b5e4761 still working on pathkurvetutils and points
01bf423 worked out clockwise profile paths
2825191 fixed typo
5a87872 still working on start and stop points for kurve
7fe77bc allowing points for start and stop of path
cb57d1b making ptlist consistant
3f2bf6c improvements to PathKurve
e3765a0 added libarea for pofile op-still much work to do
c882df2 small fix for adding arcs to edgelist
2cbac06 forgot Path_rc.py
45bf437 applied fix for windows icons not showing
61dbe07 PathUtils code cleanup
9d49cb8 Fix SortPath if no offset is specified
332eca0 split SortEdges and MakePath in prep for using kurve_funcs from HeeksCNC
799f1f1 tweaking visualization a bit
ba8eee6 small change back to way project holds toolpath for visualization
5ca4984 applied Werner's kdl patch
14c93be added units to tlo,revised centroid post
3c6341d Path: fixed spaces missing in file reading
10c20f9 removed editor button from project and post work
68ff118 removed stock command added small function to find last z value
0b71f92 tidying up profile a bit
fe8b4e9 moved the findtool function to PathUtils
4441695 Path: Exposed Command.transform() to python
09ed1d1 Path: Added a default empty preferences page
6ff0689 forgot to add the PathFromShape.py file
d6e3c4a added simple python proxy for PathShape So that it can be inserted into the Project tree automatically. Later, we can connect the base object to the shape so that it changes if the base shape is changed.
f5ca514 clean up of PathCopy.py
8336b96 moved Path from Shape to New Operation menu
7e73998 made PathCopy a child of the Project/Compound
7674b37 missed a modified file for unit handling
9aa1327 small change to account for pathcopy being InList
c35a109 PathPost doesn't barf now if the user rearranged the project.
09c4a1f working on Machine properties again
4bc32a4 more view property fixes
a453ad2 set defaults from post
3b051cb more property changes
ef5a015 reorganized properties.  Used PropertyLength/Distance in Drilling
311a059 made it so that the viewprovider settings would stick
e427303 fixed post function
3e528dc removed post processor file property from PathProject and added it to PathMachine
58a5339 added Machine object to hold post processor file name and tooltable information. Moved the cornermin,cornermax bounding box of machine to it. Haven't connected post processor file output from it yet, will do that next. Disconnected path output from Project object. It is really just a Group now that holds all the other path objects. Posts will now have to parse the objects inside it to get gcode. I think we are already doing that with the linuxcnc post and I plan on doing that with future posts. Removed a lot of view properties from lots of objects that don't need them. Use mode=2 and vobj.setEditorMode('LineWidth',mode) as an example of that. Removed placement property for things like PathComment because it doesn't make sense to try to alter placement of nongeometric things.
dd8b831 adding properties for using units
f84a2cc Multiple selection of points and circles for drilling.
f3d645a added viewprovider for drill icon in object tree
f564462 changed R plane behaviour for G81 drill cycle
85a056d added a few more drill/tap/bore cycles,changed z to R plane between drill cycles
9312ef9 Path: Added 3D representation of G81, G82 and G83 drill ops
0ed19d5 A stab at pathpocket with some reasonable properties and stepping down.
da9d6b5 forgot a quote mark
1c49c8d changed icon for optional stop
b7eb50e First bit of work on drilling.
4b3bc52 moved where comments and optional stops are located
3e9fbd7 added optional and mandatory stop commands
9e94269 added comment object
c3e44f5 removed a few properties
7cf86d7 automatic populating of tool numbers based on active ToolNumber
b607843 added tool length offset and load tool commands, made PathCompound accept objects that PathProject removed
8a93d54 reworked linuxcnc_post to use commands natively and not toGCode()
85f2cfd PathPost command now handles more cases including generic. Adds a simple dumper post to get raw commands.
aa827fa added G43 tool length offset
b1bf6d3 added new post, modded Profile for comments, fixed ZClearance in Profile
2fd5f2c added post process command and button
3cf6107 forgot about adding a file to cmake again
77f8a7f added new post, rearranged icons,modified PathProject
7e6adf3 added active property to PathPocket
d6b479a fixed stock, added active/inactive to a few ops
9a96b72 added pathplane and made fixture and pathprofile automatically populate or even create a project
d214281 forgot to add the actual script needed for stock
1adf36a added PathStock for material visualization
2ef30ea fixed bug in fixtures and changed icon
7b3e9dd made fixtures go inside a Path Project
6143c9a fixed JSON encoding error
c46cb2b added simple script to use the ToolTableEditor`
fc70a4d Turned Compound & Project into python objects
a1b9127 trying to fix segfualt
1bbf53e repaired fixture offsets
739e387 missing import. revised for new structure.  Creates multiple paths again.
38f2d25 added missing import
1837645 adding parameters to PathCompound
208bfdb Path: New pre/post interface
a252be1 rearranged and added some parameters to PathProject and PathCompound
9fa6278 Path: Added safe height property to project
de6812e made the icon a bit thicker
25beab0 merging Path-Copy with Path-Fixture
5cfffdc added icon for fixture offsets
af18281 Path: Added Path Copy object
89865ef pre support tool change and spindle speed (partially)
e9960f7 changes to opensbp post only.
421c12b Path: Fixed bug in paths with no move
272a11d added linuxcnc_post.py back to cmake
715c72b removed unused files
4ea4e18 added fixture offset script, removed unneeded scripts
855a3e0 fix for toolchange to get Tnumber to show
64f497c Path: Fixed unresponsive import/export dialogs
51c7a9e revert example post to simple form
5e25f3a Renamed pre_ and post_ scripts to _pre and _post
9837f3f first pass cleanup
9a42cee Path: Fixed scripts search path
3467a73 Path: search for pre & post scripts in user dir too - fixes #12
b46e527 Path: fixed precision bug - closes #25
c65fc05 added another post from sliptonic
718f499 Path: Enabled comments in Paths
ea0952f Path: Added preference color for machine extents
7578467 Path: Implemented machine properties  - issue yorikvanhavre/FreeCAD#8
1ae3a7d minor change to comment location
49f742d added Spindle Speed to profile
2a4374c added a second post processor example
5278d46 worked on sorting, reversing, sorting, and more sorting
7bc81bf separating selection function from PathUtils
64dd77c Path: small fix in absolute/relative coords
f435303 face selection works again
fa7074f rolled back and took another try at discretizing curves
ae1ff5b changed discretizing slightly
8e47d16 added discretizing of bezier curves to toolpaths
e85e087 fix for open wires/profiles worked on sorting again
a9a8a29 worked out arc segments over 180 degrees but not full circles yet
073a4a0 refactoring where sorting takes place
6723052 one more time on the sorting
050221c arc direction and path order-still problems but better
d7a79b1 I think I worked out backwards arc problem
a721aae corrected final depth on profile
4f07f01 I forgot to add the file for the previous commit
8eac175 combined ConvGcode and PathSelection into PathUtils
488a593 added some profile utility functions
4c4e0b2 worked on arc moves and reordering
cf04c3a Path: Added Hop tool and added arcs handlingin PathShape
417e9c7 Path: removed Tool number from dressup
4cedb9d Path: Fixed dressup
1b7e79f Path: Added UsePlacements property to compounds
8241513 Path: Added Dressup + fixed cmake + enabled python view provider
9721037 Path: Update bounding boxes when drawing path
9d8192e Path: Split compound into compound and project objects
250cdc7 Path: Added Drilling tool
8939e03 Path: Added translation file
466fe54 Path: Added an initial rapid move to FeatureShapes
7dfab6f Path: Added pocket tool
795f3c0 Path: added a ShowFirstRapid property to the path viewprovider
21e1272 Path: show number of tools in compound's task dialog
8dde2c5 Path: Added Profile tool
32b3fc1 Path: Added GUI import/export
fa1db60 Path: allow to import heeks tooltables and removed c++ workbench
e8c5a3a Path: Fixed tooltable editor
29fd0e4 Path: Allow pre scripts to return a list to create a compound
1eec4bd Path: Tooltable editor (BUGGY)
3ee661d Path: updated Path module dependencies in cmake
7137e04 Path: Added UI to reorder children of a path compound feature
3fb7073 Path: Added Path::FeatureShape feature
f496615 Path: added post editor
069b070 Path: Added structure for post scripts
bd0e669 Path: Added Path.insert() function
fcf1f18 Path: small bugfixes
09124e3 Path: Added spaces in (pseudo) Gcode output
efcb755 Path: Added pre script example
7a6a267 adding macro to find outer profile
274ff82 added a few macros
521d095 Path: Added FeatureCompound object
06eee1a adding python scripts and part files
42119ab added LGPL license
e8f0742 added demo parts and python experiments
c849734 Path: added tooltable property & Path.show() function
1886b4a Path: Added Path::FeaturePython object
b48b9d8 Path: correct placement behaviour and support for G90 and G91
00fe8a6 Path: Added support for G00
896c359 Path: Enabled different color for rapid moves
885a8d9 Path: small fix
a8d310b Path: improvements to the view provider
9fd88c5 Path: now removes comments when creating paths from gcode
dc0a0f1 Path: Fixed Z coordinate
ba6abc8 Path: Fixed color properties
8605629 Path: remember Z coord of last point if not specified
0d66fa9 Path: Misc upgrades to the view provider
f77c399 Path: Now supposes absolute positions instead of relative
a23b4e8 Path: Tooltable now behaves as a dicionary
eef5669 Path: simplified file saving/restoring
f15262f Path: enabled reading & writing of Path features
0a735ee More uniform caps system for enums, and added more materials
ad3f88e added a few more tools
ef62185 added more tools
f489758 removed whitespaces
5f906c6 added a few more tool definitions
84608dc minor changes to names
3ca1b5c Path: added Tool and Tooltable objects
d852a0b Path: extended path py object, enable coin representation in view provider
f7980b3 Path: extended the command object
a6205c4 Added Path Feature
dae6499 Path: Added Path object
693c0df Temporarily removed Gui from cmake
c2519e7 Path module: First commit
b3860d5 made a little progress- added ConvGcode to split and reverse paths
5761235 removed wire.reverse()- I couldn't get the hang of it
54a5482 added selection script along with parameters for profile
cecc1df Path: removed Tool number from dressup
7ca8e79 Path: Fixed dressup
d7d1a9b Path: Added UsePlacements property to compounds
a001d7c Path: Added Dressup + fixed cmake + enabled python view provider
5ff31b3 Path: Update bounding boxes when drawing path
946f26c Path: Split compound into compound and project objects
4c9fedd Path: Added Drilling tool
e88d431 Path: Added translation file
a989530 Path: Added an initial rapid move to FeatureShapes
8faab1e Path: Added pocket tool
e2dd1a4 Path: added a ShowFirstRapid property to the path viewprovider
5daa4ed Path: show number of tools in compound's task dialog
18bd973 Path: Added Profile tool
f613104 Path: Added GUI import/export
7e7bc79 Path: allow to import heeks tooltables and removed c++ workbench
a60325f Path: Fixed tooltable editor
802b413 Path: Allow pre scripts to return a list to create a compound
35fb2a1 Path: Tooltable editor (BUGGY)
3040bc1 Path: updated Path module dependencies in cmake
680d9a8 Path: Added UI to reorder children of a path compound feature
8ed321c Path: Added Path::FeatureShape feature
f81ccdd Path: added post editor
34d2cef Path: Added structure for post scripts
2ea3060 Path: Added Path.insert() function
e8561f4 Path: small bugfixes
ef6fe49 Path: Added spaces in (pseudo) Gcode output
909a944 Path: Added pre script example
58abd71 adding macro to find outer profile
a7415c5 added a few macros
51cd15b Path: Added FeatureCompound object
be6c10a adding python scripts and part files
30bde91 added LGPL license
93babeb added demo parts and python experiments
f69c9a9 Path: added tooltable property & Path.show() function
5796bea Path: Added Path::FeaturePython object
e6052bd Path: correct placement behaviour and support for G90 and G91
9f3977c Path: Added support for G00
1b95678 Path: Enabled different color for rapid moves
90bdc2c Path: small fix
6394ceb Path: improvements to the view provider
aa93f1e Path: now removes comments when creating paths from gcode
35a479b Path: Fixed Z coordinate
1947315 Path: Fixed color properties
987d8e3 Path: remember Z coord of last point if not specified
64da26c Path: Misc upgrades to the view provider
283df2b Path: Now supposes absolute positions instead of relative
b59a46d Path: Tooltable now behaves as a dicionary
b4c2edb Path: simplified file saving/restoring
8b36988 Path: enabled reading & writing of Path features
308bb20 More uniform caps system for enums, and added more materials
f9f129c added a few more tools
eb83a31 added more tools
bb40643 removed whitespaces
13cd406 added a few more tool definitions
6357082 minor changes to names
6a14580 Path: added Tool and Tooltable objects
bc14864 Path: extended path py object, enable coin representation in view provider
a8a19a0 Path: extended the command object
0174d04 Added Path Feature
a829a6c Path: Added Path object
ba7ca94 Temporarily removed Gui from cmake
3c9d77a Path module: First commit
2015-07-04 18:30:10 -03:00
Yorik van Havre 6c32edfb8c Fixed screenshot URL in Gnome appdata file - fixes #2179 2015-07-03 18:48:22 -03:00
wmayer e404490651 + fix broken PolyPickerSelection 2015-07-02 14:51:38 +02:00
Csaba Nagy 6b01685808 + Add command line options dump-config and get-config 2015-07-02 13:22:13 +02:00
blobfish 0c93e0bcd5 Part: ModelRefine: don't call edgefuse perform directly 2015-07-02 10:26:02 +02:00
wmayer 9687c66a25 + add missing header 2015-07-02 06:59:13 +02:00
wmayer 834c0a642d + include missing header files 2015-07-01 13:02:29 +02:00
wmayer 2b53da4eee + include missing header files 2015-06-30 17:48:03 +02:00
wmayer d826ad5b51 + Remove dependency to iisTaskPanel when not needed 2015-06-30 16:53:22 +02:00
wmayer de7c8fcbbf + issue #0002053: Support of themes 2015-06-30 13:14:56 +02:00
wmayer 28a142d94e + alternative paintEvent implementation for ColorButton 2015-06-30 01:04:43 +02:00
wmayer 48c25da133 + issue #0002053: Support of themes 2015-06-29 14:33:14 +02:00
wmayer cd0b369425 + issue #0002053: Support of themes 2015-06-28 23:30:42 +02:00
wmayer 0765dc1aae + move up/down commands with action group 2015-06-28 17:32:44 +02:00
Yorik van Havre e239c65ba1 Arch: Small fix in IFC exporter 2015-06-28 00:23:06 -03:00
Yorik van Havre c7440ef92e Added fcinfo utility
This utility prints information about a given FreeCAD file (*.FCStd)
on screen, including document properties, number of included objects
and object sizes.

It can be used as a textconv tool for git diff by adding this utility to
your exec path andadding this entry to .gitattributes: *.fcstd diff=fcinfo

Usage: fcinfo myfile.FCStd
2015-06-27 20:01:35 -03:00
wmayer eaa5b15291 + return 0 for empty icon names of Python commands 2015-06-27 19:24:11 +02:00
wmayer 882ecd3ce3 + implement class PythonGroupCommand 2015-06-27 17:21:02 +02:00
Yorik van Havre 38fffd8218 Draft: Enabled importing of SVG's symbol and use elements 2015-06-26 17:01:43 -03:00
Yorik van Havre fed516d582 Arch: fixed bug in rebars 2015-06-26 13:50:02 -03:00
Daniel Falck 1a1927b8d5 added units to Draft Point Properties 2015-06-25 23:34:01 -03:00
Yorik van Havre 89cbdb35b6 Arch: External edges are now automatically removed from Rebars base sketches 2015-06-25 19:54:57 -03:00
wmayer 864e0bcccb + make it more obvious what BRep mode for IGES export means 2015-06-25 16:41:53 +02:00
Abdullah Tahiri cac47d2548 Sketch: Bug Fix: Maintain the Elements and Constraint Widget synchronized
=========================================================================

What?
Sometimes this widgets where out of sync

Why?
Under the update only when it is redrawn policy, sometimes only one of them, i.e. the one associated with the property
triggering the updateData was updated.

Solution:
Both are updated after every redraw.

It also complements the previous bug fix related to crash on deleting, by updating the widgets to account for the deleted geometry.
2015-06-25 14:33:27 +02:00
Abdullah Tahiri 214169616d Sketch: Bug fix: On delete crash with unsuccesful solving
==========================================================

Fixes the one reported by JMG here (Thanks!!):
http://forum.freecadweb.org/viewtopic.php?f=3&t=11508#p92693

Why?
- The newly introduced redrawing policy requires that the solver geometry matches in number the sketchobject geometry.
- Most (all) problems with updateColor or getGeometry returning a null pointer are related to an out of sync between UI geometry and SketchObject geometry.

General solution:
- In other bugs, a missing "solve()" is the problem, once the solver and sketchobject geometries have the same number, an SketchObject::OnChanged triggers
a VPSketch::draw (via VPSketch::updateData) which updates the UI geometry to match SketchObject geometry and then the problem does not arise.

Particular solution:
- In this bug, the problem is not a missing solve, but the fact that the solving was not succesful and did not synchronize the geometries, however triggering a
draw() on unsuccessful solving, syncronizes the UI geometry with the SketchObject geometry and the crash is gone.
2015-06-25 14:33:22 +02:00
Eivind Kvedalen 3a69c926b5 Spreadsheet: Fixed bug in dependency tracking between objects. 2015-06-25 10:40:29 +02:00
Eivind Kvedalen 2e7b4602a9 Spreadsheet: Added initializer for Spreadsheet::RangeExpression class. 2015-06-25 10:40:15 +02:00
Eivind Kvedalen c61c12d834 Unit: Added overflow/underflow checking. 2015-06-25 10:40:00 +02:00
wmayer 165261e358 + fix memory leak 2015-06-24 20:07:36 +02:00
wmayer c3c27817b6 + whitespace fixes 2015-06-24 19:59:53 +02:00
Abdullah Tahiri 2a54fba098 Sketcher: SparseQR as default QR method
=======================================

The SparseQR is set as default method. However, in accordance with the previous commit, only if a new enough Eigen library is present will SparseQR be executed.

If the library is old and SparseQR can not be reliably used, FC will automatically fall back to use DenseQR.

This ensures that users that have a new enough library > 3.2.2 will benefit from the performance increase, while the users that use older library will still have
the same performance as in legacy FC.
2015-06-24 17:57:06 +02:00
Abdullah Tahiri ffaa0c8249 Sketcher: SparseQR conditional compilation
==========================================

For Eigen>=3.2.2 SparseQR is compiled in

For older versions SparseQR is not compiled in and if the option is selected FC gives a warning in the console and falls back to DenseQR.

This ensures that a user can get a sketch solved and work normally even if SparseQR is selected and the Eigen version is too old to support SparseQR.
2015-06-24 17:57:05 +02:00
Abdullah Tahiri 1fc88ebe24 Sketcher: Auto Update Mode bug fix
==================================

Bug:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&start=60#p92422

Why?
- When coding Auto Update Mode I forgot to solve the sketch when the constraint is cancelled to restore the solver level constraints.
2015-06-24 17:57:05 +02:00
Abdullah Tahiri 82e24d830e Sketcher: Solver Advanced Control: New Param: QR Pivot Threshold
================================================================

A new parameter added to the form in order to control how low a value should be
to be considered zero (how high a value shall be to be accounted for in rank calculation)

Debug for QR pivot threshold is also added.
2015-06-24 17:57:04 +02:00
Abdullah Tahiri 8f68b14627 Sketcher: DL Solver Debug Improvement
=====================================

- In "Iteration Level" debug mode, DL now shows the stop condition code.
- More debug code
2015-06-24 17:57:04 +02:00
Abdullah Tahiri efb08cd11c Sketcher: Disable Eigen multithread
===================================

Eigen currently only provides multithread for matrix products. It has been reported that it is even slightly slower than single-thread.
Therefore, temporarely the code is commented out. If Eigen ever implements multithread for QR decomposition, then it will make a lot of
sense to enable this.
2015-06-24 17:57:03 +02:00
Abdullah Tahiri 7f442c5a3f Sketcher: Improvement: Continuous Mode - View sketch Perpendicular
==================================================================

It allows the view sketch perpendicular button to be active during continuous mode creation (and if activated does not exit the continuous mode).

Feature requested:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11051&start=30#p92256
2015-06-24 17:57:02 +02:00
Abdullah Tahiri 22bcb40484 Sketcher: Bug fix: Dense QR is set by default
=============================================

EigenQR branch 3.2 with debug code fails an assertion. The result is generally ok if we disable the assertions, however it
eventually leads to memory leakage.

This commit reenables Eigen's assertions when in debug mode, and sets dense QR as default QR algoritm until Eigen's issue is solved.
2015-06-24 17:57:02 +02:00
Abdullah Tahiri cb2d70b4f0 Sketcher: Bug fix: Solver Advanced Control in BFGS
==================================================

- ternary operator usage was making BFGS not to iterate
- Amount of debug information for BFGS increased
2015-06-24 17:57:01 +02:00
Abdullah Tahiri 86f0df4f3c Sketcher: Improvement Continuous Creation Mode: Leave Sketch
============================================================

This enables to exit the sketch by clicking the corresponding toolbar icon, even when in creation mode, i.e.
with a drawHandler active.

Requested here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11051&start=30#p92181
2015-06-24 17:57:01 +02:00
Abdullah Tahiri f3592c1216 Sketcher: Improvements: Solver Advanced control
===============================================

- Increased solver debug
- Changing default values from float to string, as float has "only" a precision of 12 decimals.
- Default values as macros
2015-06-24 17:57:00 +02:00
Abdullah Tahiri 516b0d3c56 Sketcher: Workaround for Eigen bug: SparseQR crash on matrices with rows>cols
=============================================================================

There is an issue with an assertion in Eigen, as reported here:
https://forum.kde.org/viewtopic.php?f=74&t=117474
http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&p=92153#p92146

The work-around is to disable debug assertions for Eigen until the problem
gets solved.
2015-06-24 17:57:00 +02:00
Abdullah Tahiri 6030da1182 Sketcher: Solver improvements and bug fixes
===========================================

- Improvement Debug added to redundant solving in Iteration Mode, to show when just one iteration solved the system
- Fix wrong QR information on empty sketch
2015-06-24 17:56:59 +02:00
Abdullah Tahiri bae32f74bb Sketcher: New setting: Show advanced solver taskbox
===================================================

I makes the advanced solver taskbox by default disabled (not shown) and provides
a setting in Preferences->Display->Sketcher to enable it.
2015-06-24 17:56:59 +02:00
Abdullah Tahiri 796c9d79d4 Sketcher: New Features: SparseQR decomposition and Solver advanced control TaskBox
==================================================================================

The solver has been adapted to use Eigen's SparseQR QR decomposition algorithm. The original
Dense QR implementation is maintained and can be selected using the Advanced Control TaskBox (see below).

The use of SparseQR provides over an order of magnitude improvement in solving time in complex sketches due to
the Sparse nature of the Jacobian matrix of the system of equations.

The solver advanced control is a new TaskBox in the Sketcher that allows to select which algorithms are to be used for
the different solving operations and tweak its parameters. It is not intended to be a user control, but means to debug
solving problems and improve the algorithms and their configuration.

This commit also introduces multithread support for Eigen. Currently it is only limited to products and does not provide
a substantial speed improvement. It is expected to have more multithreaded operations in Eigen in the future.

As a bonus, the TaskBoxes in the Taskbar of the Sketcher remember the last state (collapsed or deployed).
2015-06-24 17:56:58 +02:00
Abdullah Tahiri 02df1acb5f Gui: New feature: Extension of TaskView to notify if a taskbox is hidden or visible
===================================================================================

http://forum.freecadweb.org/viewtopic.php?f=10&t=11363
2015-06-24 17:56:58 +02:00
Abdullah Tahiri 480d23f8e1 Sketcher: Bug fix: Unexpected crashes during certain operations
===============================================================

The sketcher crashed for example during effecting a fillet operation.

Cause:
The ElementsWidget/ConstraintWidget was being updated as a consequence of adding/removing geometry/constraints, and it was effecting
a selection after the update, in cases where the geometry in the screen was not being redraw (because the sketchobject was still unsolved), therefore
trying to select an element that according to ViewProvider did not exist (as it is created during redraw).

Solution:
Widgets update when their properties changes, provided that a redraw is effected (which actually also saves some (negligible) time, as they are only updated when they should).
2015-06-24 17:56:57 +02:00
Abdullah Tahiri 93c836fdcf Sketcher: Bug fix Trim
======================

In no update mode, the last constraint was not enforced. The DoF was not properly shown.

The trim operation it is always solved at the end now if in no recompute mode.
2015-06-24 17:56:56 +02:00
Abdullah Tahiri 65310f00ab Sketcher bug fixes: Crash on deleting a line from the sketch
============================================================

- Crashing on deleting line on fully constraint box

As a bonus:
- Fully constrained sketch not shown in green on opening the sketch
2015-06-24 17:56:56 +02:00
Przemo Firszt 4caa464ebb FEM: All FEM results are stored in a single object
Functionality previously provided by setNodeColorByResult is now
in setNodeColorByScalars. FemResult* object is no longer required,
the function accepts list of elements and a list of values.

Functionality previously provided by setNodeDisplacementByResult is now
in setNodeDisplacementByVectors. FemResult* object is no longer required,
the function accepts list of elements and a list of vectors.

A side effect: FemResultValues and FemResultVector are no longer used
and have bee removed.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-24 17:44:02 +02:00
DeepSOIC ed6af74a78 Navigation: fix unable to deselect after editing a sketch
After editing a sketch, it was impossible to deselect the just-edited
sketch by clicking empty space (gesture navigation).
2015-06-24 17:27:07 +02:00
wmayer 9680f13854 + fix loading of certain urls in web page 2015-06-24 13:35:13 +02:00
Fredrik Johansson 16c740a6f9 Add ability to have external orocos-kdl library instead of the suplied
in FreeCAD, used in Robot and Path workbenches

cmake switch: FREECAD_USE_EXTERNAL_KDL

Makes Robot workbench and Path compilable on OS X 10.9
2015-06-24 11:54:31 +02:00
lorenz_l bc920f9a24 set names for QTimer in mainWindow, to find them from python 2015-06-23 20:23:52 +02:00
Yorik van Havre 18624df555 Draft: Better docstring for DraftGeomUtils.fillet() 2015-06-22 22:03:13 -03:00
Yorik van Havre 4379846dfa Arch: Section planes now restore the view clipping when loaded 2015-06-22 21:58:56 -03:00
Yorik van Havre cd25a34171 Arch: added warning message when wall base is not a Part or Mesh 2015-06-21 21:45:18 -03:00
wmayer 72abf54d12 + setup qss search paths 2015-06-19 23:27:39 +02:00
wmayer 0ea718177d + set utf-8 encoding when recording a macro 2015-06-19 14:52:20 +02:00
Abdullah Tahiri 074d5d7f11 Sketcher: Bug fix External geometry not appearing upon insertion
================================================================

A last moment change to regulate redrawing introduced this issue (reducing the redrawing to the cases where the solver geometry and the sketchObject geometry are equal).
This change also solved other issues.

The case of adding external geometry is special because the DoF is the same after insertion, yet there is an insertion (as opposed to the toggle case, where there is a change but no insertion).

SketchObject has been adapted to require a solver update before moving (which also caused a non-yet-reported crash, a separate bug), and CommandCreateGeo has been adapted to trigger a solve with
auto update mode disabled. This solve is a very low cost one as the geometry is already in place.
2015-06-17 14:53:34 +02:00
Yorik van Havre 8b4492ebc5 Arch: small bugfix in cutvolumes 2015-06-17 09:45:01 -03:00
wmayer 238becaebb + further optimization in sketcher 2015-06-16 10:18:11 +02:00
wmayer 788fadf4a8 + fix const correctness 2015-06-15 23:42:37 +02:00
Abdullah Tahiri ec5f3b2b98 Sketcher: new Feature: Group creation of Sketcher geometry and other improvements and bug fixes
===============================================================================================

Group creation:
- complex geometries (consisting of several geometry elements and constraints) have been rewritten to use python list (one command call for all geometries and constraints)
- Ellipse ExposeInternalGeo as group creation of geometries and constraints

To construction mode creation:
- addGeometry python and SketchObject functions modified to take an additional optional parameter "construction" to create the geometry/geometries directly as construction.
  In addition to the shorter form, this helps generate less amount of onChange propagation and Redraws.
- all the geometry creation commands in CommandCreateGeo.cpp have been rewritten to use the new construction argument. This includes modifying the regular polygon script to
take a new optional parameter to create geometry as construction in addGeometry.
- special care is taken in group creation not make construction points
- Show/hide internal geometry implemented with this option.

To solving:
- the solve previously included after every geometry addition (when in no Update, e.i. no Recompute mode) has been removed and each Gui::Command calls either an UpdateActive
for recompute or a Solve in no Update mode. This is behaviour is less intrusive and uniform with group creation.

Bug fixes and redrawing reduction:
- Fixes the CheckId exception problem. The solution also helps further remove redraws during creation of complex geometry (e.g. Slot)
- Fixes touching the sketch by only opening it.
- Code clean up.
2015-06-15 22:56:36 +02:00
Abdullah Tahiri 61bd2d41ac Sketcher: Requested Feature: Remove help button
===============================================

The help button next to the close button in the Task dialog is now removed.

It was requested that this button is removed as it is inconsistent with other help sources and it is not implemented.
2015-06-15 22:56:20 +02:00
Abdullah Tahiri d1acd124cc Sketcher: Bug fix: Undo/Redo implementation
================================================

Fixes a bug in master that the dependent 3D geometry would not update on Undo (in Auto update mode enabled).

Undo and redo signals are handled by ViewProvider in order to introduce an recompute or solve() of the sketchObject
as determined by the Auto Update Mode in order to update DoF and dependent geometry if necessary.
2015-06-15 22:56:04 +02:00
Abdullah Tahiri da5270131c Gui New Feature: Gui::Document support for App::Document undo and redo signals
==========================================================================

It defines new slots connected to App::Document's signalUndo/signalRedo, which
triggers Gui::Document's signalUndoDocument and signalRedoDocument signals.

setModified is not executed upon redo/undo, as this is already done on modification of the properties if
properties were modified, and if there were not, no setModified is needed anyway.
2015-06-15 22:55:49 +02:00
Abdullah Tahiri eb7a3c763c Bug fix: General reduction solution / new sketch solving model
=================================================================

The new solving architecture focus all the solving on the SketchObject.

Actions that change the DoF can call execute() (i.e. recompute) or Solve() depending on whether a full recompute of dependent features is required or not.
In both calls the geometry of the solver is updated with the geometry of the SketchObject.

The only additional call that calls the solver is MovePoint. This function may or may not update the geometry of the SketchObject
(as now it is intended for UI related solving, like dragging, rubberbands, ...).

In operations that do not involve a change of DoF and therefore do not require a sketch solving, it may happen that as a side effect of moving a point, the
geometry changes to old behaviour. In order to avoid that, those SketchObject operations, as for example setConstruction or ToggleConstruction,
must set a flag "bool solverNeedsUpdate" to true. In case a movePoint is executed before any other solver execution, the geometry is first updated and then
the moving is performed.

So to keep in mind when programming sketcher operations:
-> Need recompute (UpdateActive)
-> Need solving because DoF changed (solve())
-> The operation does not change DoF (set solverNeedsUpdate to true)
2015-06-15 22:55:28 +02:00
Abdullah Tahiri 4b0bd78814 Sketcher: Bug fixes to Auto-Update Mode
=======================================

- Fixing toggle AutoUpdate Mode
- Fix Auto-Update Sketcher tools
- Fix missing createGeo recomputes
- Missing constraints recomputes fixed

Various fixes for non-Update mode:
- Fixes lack of update upon entering a conflicting datum constraint.
- Fixes lack of update upon setting the reference/driving status of a constraint

- Added tooltips to buttons
2015-06-15 22:55:04 +02:00
Abdullah Tahiri 339717c96f Sketcher: Bug fix of New Solver Model: DoF and solver update on deletion of constraints
=========================================================

Upon deletion of a constraint, the constraint was still enforced for UI operations (dragging of a point) and DoF was not updated.
2015-06-15 22:54:49 +02:00
Abdullah Tahiri a21265f9b6 Sketcher: New Feature: Avoiding to continuously recompute all the sketch (and dependent objects)
======================================================================================

There is a checkbox, default disabled, that makes the commands NOT to generate a recompute after each.
This means that if you are editing a sketch that is used to generate a pad or pocket, if the checkbox is
disabled, the dependent objects do not get recomputed.

There is a button next to it to force a manual recompute, in case it is needed.

If the user wants the previous behavior, he only needs to activate the checkbox. The previous status of the box
is restored upon entering a sketch in edit mode.

It is remarkable the case of the Fillet and Trim

On changing ActSketch (solvedSketch) to SketchObject and making movePoint not systematically update the geometry, the solving in MovePoint was confronted with solving for "the last solved geometry",
which is the default behaviour, in some situations (Fillet and Trim) where geometry had changed at SketchObject level, and was the subject of the moving actions.

MovePoint has been updated to take an extra optional parameter, to force the change in solved geometry in those situations.

Some other minor bug also fixed in Fillet creation in CommandCreateGeo.cpp

This commit also introduces conditional recompute on some operations of:
- constraints
- geometry creation (reubication of update active to comprise the autoconstraints within a single UpdateActive)
2015-06-15 22:54:32 +02:00
Abdullah Tahiri 0e92e6356f Sketcher: Major re-structuration: New Solving Model: General Sketch Solve call reduction
=======================================================================================

ActSketch in ViewProvider dissapears. The temporal sketch (sketch.cpp) for solving is now a data member of SketchObject.cpp (hereinafter solvedSketch). All the solving is concentrated in SketchObject.cpp.

SketchObject provides an interface to expose its solver, as it is still currently needed for some UI operations from ViewProviderSketch, like dragging points (solving rubber bands).

ViewProviderSketch still can select whether to draw the solvedSketch geometry (previously ActSketch) geometry (UI staff) or the SketchObject geometry. Performancewise, it makes sense to separate this two
geometries, as the SketchObject one involves modifying the Geometry and Constraint Properties (including all the undo related functionality), which would mess the undo functinality and incur in a big
peformance penalisation while dragging. One characteristic of solvedSketch is that its geometry is solved, whereas the geometry of SketchObject may not have been solved yet.

These geometries may differ at for the following reasons:
1. The geometry corresponds to an ongoing dragging operation, so solvedSketch has the last calculated dragging geometry, while SketchObject has the one corresponding to initial position.
2. Geometry/constraints were added to the sketch, but no solve/execute was triggered yet (envisioned situation is the future group creation functionality not in this commit).

What do I gain?

- Inserting a (simple) geometry element now costs 1 solver execution.
- Inserting a constraint now costs 1 solver executions.

For reference, in previous versions inserting a constraint involved 5 solver executions.

The following information provide a historical review of the coding of this commit (formed of 10 squashed commits):

This is a general sketch solve call reduction, not only during geometry creation (this commit does not include until here any specific measure to reduce calls on geometry creation, that is another branch)

After a lot of profiling, it seems that the "cause"(tm) that creates so many solver calls is that every update generates a solving in ViewProviderSketch, regardless of the need for that update,
many times with the only aim of providing the DoF for the message dialog and keeping ActSketch in sync with SketchObject in case it is needed (currently UI moving points, constraints,...).

Sketch solver is now a data member of SketchObject instead of a temporal object that gets initilized and destroyed.

This allows:
1. Potentially more synergy reducing calls to setUpSketch (still to be seen, still to be optimized)
2. Allowing SketchObject to access the latest geometry that has been solved => In future, allow objects that use SketchObject to obtain the latest
solved geometry instead the geometry of SketchObject that may still be unsolved. This is relevant for drawing the geometry

No more solving in ViewProviderSketch. Solving a Sketch is now an exclusive competence of SketchObject.

There is however a lot of cleaning to do in ViewProviderSketch

(I mean, not that these commits are making a mess in VPSketch,
but that as a consequence of the changes, it should be possible to
optimize VPSketch, specially moving and drawing methods)

Very useful comment for future developers that may wonder why a solve per constraint just upon addition is necessary.

Added a new function to get the size of the geometry of the instance of the solver object (Sketch.cpp).
The previous way was to extract the geometry, which is costly and error prone, as you have to delete it afterwards.

Inserted comment about the necessity of triggering a Part2D update during edit mode
2015-06-15 22:53:59 +02:00
wmayer 280019ddf9 + implement Geometry.copy for Python 2015-06-15 21:28:29 +02:00
Eivind Kvedalen f99fd100e6 Added zoom and automatic refresh of dependency graph view. 2015-06-15 11:32:24 +02:00
Yorik van Havre 1749ff2d5d Added a Revert command to the File menu - fixes #2040 2015-06-14 22:58:07 -03:00
Yorik van Havre d0cfe4b010 Arch: Allow to build Arch objects from Part Compounds - fixes #2095
Arch objects can now be based on a Part Compound and will take
its DiffuseColor property. Arch objects that are clones of
such objects will also copy that property.
2015-06-14 18:36:54 -03:00
Eivind Kvedalen d0d98b8775 Spreadsheet: Fixed exception bug in SheetPy::setCustomAttributes(...). 2015-06-13 12:48:21 +02:00
Eivind Kvedalen e864bb8d92 Spreadsheet: Added test macro. 2015-06-13 12:47:52 +02:00
Eivind Kvedalen efc21a5a63 Spreadsheet: Removed superfluous fc_target_copy_resource call in CMakeLists.txt. 2015-06-13 12:47:36 +02:00
Eivind Kvedalen 9d5d05a708 Spreadsheet: Fixed handling of unary minus/plus, exponentation order, and unit rule (#2099) 2015-06-13 12:47:19 +02:00
Eivind Kvedalen 12e4d59458 Spreadsheet: Fixed bug in setEdit method for Spreadsheet module (#2144) 2015-06-13 12:46:53 +02:00
Yorik van Havre edbbcfb790 Draft: Fixed placement of one-face Facebinders 2015-06-12 11:08:49 -03:00
Yorik van Havre 40f8bb4143 Arch: Fixed encoding bug in IFC export 2015-06-11 23:02:29 -03:00
wmayer 5040a97b0b + filter out removed workbenches 2015-06-11 00:19:20 +02:00
wmayer 4a7419c064 + fix whitespaces 2015-06-10 23:21:46 +02:00
Przemo Firszt 615d037de0 App: Add workbenches with unknown status to enabled list
Newly installed workbenches are not on enabled nor disabled list, so
they were treated as disabled. That behaviur could be confusing for
the user as a newly installed workbench was not shouwing up on the
workbench list. This commit changes that behaviour and new workbenches
are enabled by default.

Reported-by: r-frank
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-10 22:11:24 +02:00
wmayer 4f5534a87a + fixes #0002116: FreeCAD crash when I click on treeview 2015-06-09 21:55:35 +02:00
wmayer 54317becbf + fix writing STEP settings 2015-06-09 21:23:16 +02:00
Przemo Firszt 3a7772d0f7 FEM: Save/restore result dialog settings
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 793a5b79f1 FEM: Rename dialog element callbacks
Also setDisplacement function has been removed

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 5853eabc62 FEM: Always import FemGui
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 6de28c158d FEM: fix white space
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt f5146b8d43 App: fix typo
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 9766893be1 FEM: Change FEM results selection to radio buttons
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt f29b003810 FEM: Add reset_mesh_color and reset_mesh_deformation functions
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt ca47eeaeff FEM: Remove unused property
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 6df5809c33 FEM: Optimise check_prerequisities
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt da83e47241 FEM: Remove old results before loading new set
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Przemo Firszt 157399e395 FEM: Fix problem with using old displacement value after recalculation
Reported-by: bernd
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-09 13:07:49 -03:00
Yorik van Havre beedcc06fe New splashscreen 2015-06-09 11:36:19 -03:00
Yorik van Havre 895510e08d Draft: small bugfix in Drawing view 2015-06-08 19:05:37 -03:00
Yorik van Havre 48113f3bca Arch: Fixed encoding in IFC import - fixes #2149 2015-06-06 12:52:44 -03:00
Ian Rees 418cefd7ee Cleaning up compile warnings, mainly in Sketcher
fabs() instead of std::abs(), add cmath include
2015-06-04 18:12:39 +02:00
DeepSOIC 37fbcb64a6 Part: new tools - JoinFeatures (Connect, Embed and Cutout)
Attributions:
Mark (quick61) - icons
Yorik - help with internationalization
Everyone who appeared in forum thread "A new Part tool is being born...
JoinFeatures!" - for endorsement!
http://forum.freecadweb.org/viewtopic.php?f=22&t=11112
2015-06-04 09:47:59 +02:00
Ian Rees 5ced7e5cbe Add #include that's required with Homebrew 2015-06-04 09:54:20 +12:00
wmayer c3808cd991 + Use update mechanism for CmdSketcherToggleConstruction 2015-06-03 19:12:48 +02:00
wmayer cf1a77a44d + Use update mechanism for CmdSketcherToggleDrivingConstraint 2015-06-03 18:31:30 +02:00
wmayer c91018946c + Extend Command framework to allow to update QAction 2015-06-03 18:30:36 +02:00
Yorik van Havre 0fec404c6d Arch: fixed Label encoding in IFC export 2015-06-02 19:58:59 -03:00
wmayer 1808fd83ed Expose attribute to Python to access icon of view provider 2015-06-02 16:21:56 +02:00
Przemo Firszt 4e94c02dda FEM: Rename animateNodes to applyDisplacementToNodes
Also animateNodes is now applyDisplacementToNodes.
The funcions are not doing animation, but are responsible
for deforming mesh.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt 8195ce579b FEM: Remove not used setColorStress function
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt aed303f4ff FEM: Add curly brackets to one line for/if or if/if commands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt 70318d7820 FEM: Disable Show result button if there are no results in analysis
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt 749e772d85 FEM: Add Purge FEM results button
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt 97a6333f87 FEM: Simplify setting FEM results when user selected None
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt 302dbbf0be FEM: Fix problem with Show button not reverting mesh deformation
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:34 +01:00
Przemo Firszt dc7da86261 FEM: Don't use bool as variable name
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:21 +01:00
Przemo Firszt 6a13a51b90 FEM: Don't check is Show is checked after slider has been moved.
Slider is disbled is Show is not ticked, so that check is redundant.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:35:10 +01:00
Przemo Firszt 74234e7000 FEM: Switch to reading analysis stats from AnalysisStats object
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt 597c9b856b FEM: Add AnalysisStats object
This commit add a new object to Analysis: AnalysisStats. AnalysisStats
contains list with 15 values (an example):
-0.000776373	<-- minimum X displacement
-7.74494e-06	<-- average X displacement
0.000774115	<-- maximum X displacement
-0.00416267	<-- minimum Y displacement
-0.00204191	<-- average Y displacement
0		<-- maximum Y displacement
-0.000775108	<-- minimum Z displacement
1.09288e-05	<-- average Z displacement
0.000775122	<-- maximum Z displacement
0		<-- minimum Abs displacement
0.00214509	<-- average Abs displacement
0.00430481	<-- maximum Abs displacement
0.390598	<-- minimum Von Mises Stress
0.93509		<-- average Von Mises Stress
1.47765		<-- maximum Von Mises Stress

Those values will be used to set field values in FEM results dialog
instead of currently used values returned by setNodeColorByResult
function.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt 9c6ee0ac63 FEM: simplify reading lines from frd file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt f5863b6d9b FEM: replace input with frd_file in ccxFrdReader.py
input is a built-in function name and should not be used as variable name

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt 05cb44bfb0 FEM: use is instead of == for None in ccxFrdReader.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt 39b407fdba FEM: replace deprecated has_key in ccxFrdReader.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
Przemo Firszt cd5cc689dc FEM: white space fixes in ccxFrdReader.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-02 11:28:44 +01:00
J.L. Cercos-Pita b27e512828 Corrected the wetted surface units 2015-06-01 12:00:30 -03:00
J.L. Cercos-Pita 657041d6b1 Updated the spreadsheets to the new module 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita f7be7d1e30 Fixed the locales 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita dfa96bd3fe Fixed the locales in the Hydrostatic tools 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita 63360966f9 Fixed the problems with the group separator in some locales 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita 3a52249400 Extended the locale fixe to the stored variables into the Ship instance 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita f867db6f71 Fixed the problems with the group separator in some locales 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita 5c79b2f762 Updated the areas computation tool to the new spreadsheet 2015-06-01 12:00:29 -03:00
J.L. Cercos-Pita 071829dbc9 Fixed 'Axes' object has no attribute 'get_frame' error (see http://matplotlib.org/api/api_changes.html) 2015-05-31 19:28:16 +02:00
wmayer 2e14552a50 + fixes #0002134: FreeCAD crashes when the window is restored and a plot is shown 2015-05-31 17:29:30 +02:00
wmayer a12f700aa2 + fix some warnings 2015-05-30 20:59:25 +02:00
wmayer 351e7aae6f + fix wrong default of ContinueMode in settings panel 2015-05-30 20:42:33 +02:00
wmayer eef340f19c + fix whitespaces 2015-05-30 20:30:12 +02:00
Abdullah Tahiri 3b1873f1dc Sketcher Improvement: Always enable geometry creation
==============================================================================

Now you can switch from one tool to the next just by clicking on the next tool
2015-05-30 16:39:34 +02:00
Abdullah Tahiri ca356c308e Sketcher Driving/Reference and Construction/Normal single buttons icons
=======================================================================
2015-05-30 16:39:33 +02:00
Abdullah Tahiri 0bd3801314 Sketcher: UI Improvement Smart button for constraints and geometry toogle/creation
==================================================================================

Geometry button:
- if no object selected, the legacy toggle icon has a new functionality, switch to/from creating in construction mode
- if object selected, it has the legacy functionality
- the button can be clicked during "continuos creation mode" to switch from creating to/from creating in construction mode

Constraint button:
- The button is not selectable if nothing is selected (it would be impossible to determine the effect)
- When constraints are selected, the button toggles the constraints to/from Driving.
- When geometry is selected, the button switches from/to reference mode, the change is apparent from the color of the constraint icons.

Continuous creation mode:
- Default changed so that it is active unless you change it in settings

Updated terminology
2015-05-30 16:39:32 +02:00
Abdullah Tahiri a1c3b942aa Sketcher: Driving/reference creation improvements and some other fixes
======================================================================

- Changing from Driving to reference does not include unnecessary solvings.
- Added some checks to avoid making Driving constraints when calling directly from python and involving only external geometry (would give redundant constraints).
- New python command toggleDriving to just change the status from reference to Driving
- New UI toolbar Command to toggle constraints
- Fix to allow switching from/to construction mode during continuous mode creation.
- Enable/Disable for constraints in constraints widget has changed to operate on multiselection and now effects "toggle" instead of enable/disable.
- Disable the option to directly create a SnellsLaw non-driving constraint (this constraint does not support direct creation, it can be toggled to non-driving after creation though).
2015-05-30 16:39:32 +02:00
Abdullah Tahiri 4dfc96e102 Bug fix: Point was created as construction on construction mode
==============================================================

Points should not be construction points.
2015-05-30 16:39:31 +02:00
Abdullah Tahiri 8685e94b76 Bug fix: Sketcher fillet on construction lines
==============================================

The fillet applied to construction lines generates normal (not construction) geometry.

How to replicate?
1.Make a square and make all lines construction lines.
2.Apply fillet tool, there result will be a white line fillet connecting two blue constructions lines.
2015-05-30 16:39:31 +02:00
Abdullah Tahiri 75fa12964e Sketcher Driving/reference mode icons 2015-05-30 16:39:30 +02:00
Abdullah Tahiri 765b720c48 Sketcher New Feature: Toggle Mode for Reference/Driving constraints
===================================================================

It allows to create constraints directly into Reference or Driving mode.

It does not include icons
2015-05-30 16:39:30 +02:00
Abdullah Tahiri d5ec887526 Sketcher: Construction Mode Icons 2015-05-30 16:39:28 +02:00
Abdullah Tahiri 1c803df7d4 Sketcher new Feature: Creation Mode of geometry
===============================================

It allows to select whether the geometry will be created as construction geometry or normal geometry.

This commit includes an important bug fix to reduce the number of times the sketcher solver is called when toggling
geometry. It makes an important difference in the creation during construction mode and InternalAligment geometry like the ellipse.

This commit does not include icons.

You have a button next to toggle that after having been clicked, switches from Normal to Construction geometry and vice versa
2015-05-30 16:39:28 +02:00
Abdullah Tahiri 3231a0c92a Sketcher: New Feature: External Geometry Linking improvement
============================================================

It lifts the need of clicking on the external geometry icon upon importing each external geometry element.

All the elements on which the user clicks are imported until the user right clicks with the mouse or presses ESC, like the Trim or Fillet tools.
2015-05-30 16:39:27 +02:00
Abdullah Tahiri ba5a8fe87c Sketcher: New Feature: Continuous creation mode
===============================================

When creating a type of geometric element, the user can create as many elements of that type he wishes without having to click the button before each insertion.

The insertion of that type of elements ends by pressing ESC or clicking the right button of the mouse.

This mode is by default disabled and can be enabled in Preferences->Display->Sketch->Geometry Creation "Continue Mode".
2015-05-30 16:39:26 +02:00
Abdullah Tahiri f7c9566f1e Sketcher bug fixes: Non-driving constraints editable on double click and color settings not working
===================================================================================================

This fixes a bug in the original implementation, that a non-driving constraint value could be
edited by double clicking on it in the 3D view.

It also includes minimal documentation on some functions.

It also includes:
- Color setting for non-driving constraints was not working.
- Settle UI terminology dispute:
  * Driving Constraint (normal red constraint)
  * Reference Constraint (non-driving constraint)
2015-05-30 16:39:26 +02:00
Abdullah Tahiri ad180fb2c3 Sketcher New Feature: Non-driving constraints Icons by bejant
=============================================================

Nice icons to differentiate driving from non-driving constraints by bejant
2015-05-30 16:39:25 +02:00
Abdullah Tahiri bc85670ce9 Sketcher new Feature: Non-driving constraints (aka Driven constraints or dimensions)
====================================================================================

It allows to enable and disable a constraint in the constraint list.

When disabled, the constraints current value is shown, but its value is not enforced (it is driven by the other constraints and user interaction).

A disabled constraint can be enabled (as far as it is enforceable, see non-driving constraints to external geometry below).

The sketcher functionality has been extended to support non-driving constraints to external geometry elements. This were previously excluded from
the possibility of creating a constraint on them (as their values depend on other sketches and would be redundant with the unchanged value or conflicting when value is changed).
Now these constraints are created as non-driving, but as they are not enforceable, the UI does not allow you to make them driving.

The constraint filter has been extended to include a Non-Driving constraints category.

Thanks again to Werner for his continuous support, and specially in this case to DeepSOIC, as he pointed towards a much better implementation solution than my original idea.
2015-05-30 16:39:25 +02:00
Abdullah Tahiri 5676c632f6 Bug fix: Sketcher Polygon autoconstraints
=========================================

The autoconstraints on creation of an hexagon were not working.

How to reproduce?
1. In a sketch make a couple of lines
2. Create an hexagon (or other polygon of your choice) with center in one end of a line and with side coincident with the end point of the other line

Result:
Neither the center nor the side autoconstraints are properly created.

Fix:
Straightforward. Just correct the indexes. Last is always the circle. Last but one is always a side.
2015-05-27 16:22:31 +02:00
wmayer 24b71377e1 + fix whitespaces 2015-05-26 17:55:38 +02:00
Przemo Firszt cd4952dee4 FEM: fix white spaces in ccxInpWriter.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-26 14:33:43 +01:00
Przemo Firszt e13a8cf304 FEM: Add ConstraintPressure
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-26 14:17:45 +01:00
Bernd Hahnebach 3c629f095d FEM: CLOAD, mesh face area is used for surface loads on volume faces 2015-05-26 13:50:38 +02:00
Abdullah Tahiri 81bd2cf34a Bug fix: Sketcher: "Ask for value after creating distance constraint" setting not working
========================================================================================

How to replicate:
1. Go to Preferences->Display->Sketch and disable that checkbox.
2. Create a distance constraint (radius, distance, ...)

It will ask for the value regardless of whether the checkbox is clicked or not.

Why?
In SketcherSettings.ui the prefpath is "Mod/Sketcher"
The code refered to ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
2015-05-26 13:45:24 +02:00
wmayer a2bdc366f0 + make sure that Sketch.clear() doesn't allow any arguments 2015-05-26 13:11:48 +02:00
Abdullah Tahiri b5ff8cdc82 Sketcher Bug fix: Python function clear() contains wrong code
=============================================================

This function is like this from 2011 according to git blame.

The original code makes no sense. I assume that what is intended in this
function (in accordance with SketchPy.xml) is call the method clear in
Sketch.cpp.
2015-05-26 13:08:22 +02:00
wmayer b882109cb1 + rename method for points of selection 2015-05-26 12:51:39 +02:00
wood-galaxy 7843225fad Arch : Arch Section take current WorkingPlane Placement 2015-05-24 17:03:45 -03:00
Przemo Firszt c5903523ea Part: PartDesign: Fine tune chamfer, fillet and draft icons
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-24 10:52:26 +01:00
Yorik van Havre bb3be15ff5 Draft: Removed the 'Hide Draft Workbench' Draft preference since we now have full WB customization 2015-05-23 13:17:50 -03:00
wmayer 1099b23587 + raise error message when trying to mesh without netgen support 2015-05-22 16:15:18 +02:00
wmayer a4441f2a41 + implement missing methods of Python API for SelectionObject 2015-05-21 12:45:36 +02:00
wmayer f20519d352 + new parameter 'CoinOffscreenRenderer' to use Coin's offscreen renderer 2015-05-20 22:11:25 +02:00
wmayer ef610c8c96 + remove SoFCSelection from ViewProviderGeometryObject 2015-05-20 21:44:27 +02:00
wmayer 27863408c9 + remove references to SoFCSelection where not needed 2015-05-20 19:24:12 +02:00
wmayer 562ecea9cf + fix text in drawing dialog 2015-05-20 18:16:49 +02:00
wmayer dbfedbdeae + fix a few minor issues in DlgWorkbenchesImp and QListWidgetCustom 2015-05-20 11:18:46 +02:00
jriegel d5ae1988b8 small fix in README 2015-05-20 06:49:23 +02:00
jriegel aa142250e0 add shell and beam support to FEM mesh ViewProvider 2015-05-19 21:42:36 +02:00
wmayer 4ae424b44a + fix minor bug in string concatenation 2015-05-19 21:18:45 +02:00
Kirill Gavrilov be70bad701 + fixes #0002108: Add OpenCascade navigation style 2015-05-19 20:24:09 +02:00
Kirill Gavrilov e75fd5e69a + fixes: #0002109: Matrix4D - add missing constructor body 2015-05-19 20:10:48 +02:00
Yorik van Havre afef89a8ef Arch: Fixed materials merge in IFC import 2015-05-19 10:15:07 -03:00
Przemo Firszt 4c383527f8 App: Add dialog to pick preferred workbenches
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-18 22:25:59 +02:00
Przemo Firszt b507505a47 FEM: Fix crash on missing unit when editing material second time
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-18 17:09:30 +01:00
Przemo Firszt b7e7f1f40a Base: Handle Unit::Stress tha same way as Unit::Pressure in UnitsSchema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-18 16:43:45 +01:00
Przemo Firszt 4729cafdcc Base: Fix GPa/MPa units in UnitsSchemaMKS.cpp
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-18 16:37:09 +01:00
Yorik van Havre 691b1af944 Arch: Added pref option to IFC import to treat materials with same name as one 2015-05-17 14:22:24 -03:00
wmayer 9431d301d3 + for VRML and OpenInventor export only selection, fix whitespaces 2015-05-17 13:53:22 +02:00
wmayer 994fbd072a + whitespace fixes 2015-05-17 12:53:00 +02:00
wmayer f8eb61fdf8 + prepare OCAF document to keep placement 2015-05-16 21:41:53 +02:00
wmayer 854b4be506 + prepare OCAF document to keep placement 2015-05-16 18:01:57 +02:00
wmayer 00a124cea1 + Pad type UpToFirst and UpToFace doesn't produce expected results. 2015-05-16 14:19:20 +02:00
wmayer a6436f7d12 + fixes #0001655: Pocket type UpToFirst and UpToFace doesn't produce expected results. 2015-05-16 12:44:07 +02:00
wmayer 78671cb27e + raise exceptions in TopoShape::makeOffsetShape if needed 2015-05-15 20:20:37 +02:00
wmayer 4fe99f2658 + whitespace improvement 2015-05-15 20:07:55 +02:00
blobfish 0950e1963a Part: Offset: fill rework. 2015-05-15 20:00:47 +02:00
blobfish cb2002d188 Part: ModelRefine: fix for bug# 2097 2015-05-15 18:06:33 +02:00
Yorik van Havre 25da93e2ea Arch: small bugfix in IFC importer 2015-05-15 11:27:15 -03:00
wmayer 96e77ab5bf + FEM: replace set with list to preserve order 2015-05-15 13:48:29 +02:00
wmayer 84d579186c Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-05-13 12:01:23 +02:00
Yorik van Havre a6fad36ab6 Arch: small bugfix in windows 2015-05-12 23:26:41 -03:00
Yorik van Havre c7c5171233 Draft: fixed typo 2015-05-12 22:14:06 -03:00
Przemo Firszt 29044021cd FEM: Fix Von Mises equation
Reported-by: sgrogan and confirmed by drei

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-12 15:58:49 +01:00
Yorik van Havre bcec2d45ad Arch: Added MDF presets to panel 2015-05-10 11:30:01 -03:00
Sebastian Hoogen d4f3cb7277 use transformGeometry in importSVG
partly reverts f045df1ef3 as workaround
for issue #2062
2015-05-09 19:57:36 +02:00
Yorik van Havre 31cecf79a1 Draft: Added archang's patch to importDWG 2015-05-09 12:39:53 -03:00
wmayer 1f1acad4f8 + set appropriate step size in clipping dialog 2015-05-09 14:54:28 +02:00
wmayer 45604b3874 + use list of pairs instead of map for getVolumesByFace 2015-05-09 12:02:25 +02:00
wmayer fbdfeef2a3 + add method getPolesAndWeights() to NURBS surfaces and curves 2015-05-09 00:58:07 +02:00
wmayer 814c144ecb + FEM: add a couple of methods to Python interface 2015-05-09 00:15:05 +02:00
wmayer 9e89f2ff9a + implement FemMesh::getVolumesByFace, replace inner list by tuple 2015-05-08 21:45:13 +02:00
Przemo Firszt cd6088332f FEM: Fix invalid CLOAD formatting
Existing code was producing invalid results:

a = 9876543212346789864323456.9543234578986432345678
>>> print "{:.13}".format(repr(a))
9.87654321234
>>> a
9.87654321234679e+24
The new converision should work fine:
>>> print "{:.13E}".format(a)
9.8765432123468E+24

Reported & fixed by ulrich1a
2015-05-08 20:59:32 +02:00
Przemo Firszt 6ab70bece6 FEM: inp file formatting/typos
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-08 20:59:14 +02:00
Przemo Firszt 48efcc449b FEM: Add getccxVolumesByFace and write_face_load functions
getccxVolumesByFace returns std::map<int, int> with ID of volume
and a number of face as per CalculiX definition. The same function is
accessible for python and returns list with the same information, like
this: [[229, 3], [230, 3], [233, 2], [238, 2]]

write_face_load produces something like this in the .inp file:

***********************************************************
** element + CalculiX face + load in [MPa]
** written by write_face_load function
*DLOAD
** Load on face Face2
229,P3,10.0
230,P3,10.0
233,P2,10.0
238,P2,10.0

Optimised by wmayer

Signed-off-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-08 20:58:59 +02:00
Przemo Firszt be43c7f5c0 FEM: getNodesByVertex should return int not long
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-08 20:58:43 +02:00
Przemo Firszt 3395d4ea02 FEM: getNodesByEdge should return int not long
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-08 20:58:26 +02:00
Przemo Firszt 0e670396fa FEM: getNodesByFace should return int not long
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-08 20:58:07 +02:00
wmayer 72a0c490ac + use right iterator variable 2015-05-08 12:40:57 +02:00
wmayer 2dd871389e + fix branding bug, use tr() function of class not QObject 2015-05-08 01:08:19 +02:00
wmayer 4efaacc5b3 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-05-08 00:54:36 +02:00
wmayer f840f89922 + switch between old and new offscreen renderer 2015-05-08 00:54:09 +02:00
Yorik van Havre 6c7911a602 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-05-07 18:17:50 -03:00
Yorik van Havre dd78ad7e72 Better message if qt help file is not found - fixes #2084 2015-05-07 18:17:35 -03:00
Yorik van Havre 24e310ec57 Arch: Fixed makefile 2015-05-07 18:14:52 -03:00
wmayer 00438fffd2 + before trying to write out snapshot image check if it's null 2015-05-07 23:07:20 +02:00
Yorik van Havre 7b1135a3e9 Arch: moved some ui files to resource 2015-05-07 17:38:24 -03:00
Yorik van Havre a9ecbdc802 Arch / Draft: reorganized preferences files 2015-05-07 17:06:56 -03:00
wmayer 54220d5040 + handle case when workbench fails to be created, fix problem when inserting menu 2015-05-06 10:47:51 +02:00
wmayer 13070cbe23 + improve doc string 2015-05-04 15:20:23 +02:00
wmayer 477b3ce3f2 + fixes #0002085: Only one Toolbar Separator 2015-05-03 21:32:24 +02:00
wmayer 6cd9220079 + show build type 2015-05-02 17:56:44 +02:00
wmayer 74c912f169 + fixes #0002064: Editable text changes in drawing template not restored. 2015-05-02 13:14:38 +02:00
wmayer 894e66056e + show build type 2015-05-02 02:13:13 +02:00
wmayer f6c25f94de + code cleanup: remove deprecated class ViewProviderPartBase 2015-05-02 00:37:05 +02:00
wmayer 58b54aa729 + code cleanup: remove NO_USE_QT_MDI_AREA 2015-05-01 23:27:20 +02:00
wmayer b35d28a941 + whitespace fixes, add curly braces to outer loop 2015-05-01 18:49:20 +02:00
DeepSOIC 24797fb65e Sketcher: allow mass selection for Point-on-object constraint 2015-05-01 18:31:18 +02:00
Przemo Firszt 605e8cd72c FEM: Add comments to .inp file about functions
Adding detailed information which function is responsible for
creating a proticular section of the .inp file should save
some guesswork. An example from the .inp file:

[..]
***********************************************************
** node sets for loads
** written by write_load_node_sets function
*NSET,NSET=FemConstraintForce
1,
3,
[..]

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:30:53 +02:00
Przemo Firszt beb6cecf59 FEM: Use local variable to avoid long strings in write_constraints_force
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:30:35 +02:00
Przemo Firszt dec69a8769 FEM: Use local variable to avoid long strings in write_constraints_fixed
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:30:20 +02:00
Przemo Firszt 0b7c02850e FEM: Use local variable to avoid long strings in write_materials
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:30:05 +02:00
Przemo Firszt 5bf115ddba FEM: Use local variable to avoid long strings in write_load_node_sets
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:29:48 +02:00
Przemo Firszt 39fd6d9217 FEM: Material name has to be limited to 80 characters for ccx
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:29:30 +02:00
Przemo Firszt 27e43f6939 FEM: Use local variable to avoid long strings in write_fixed_node_sets
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:29:14 +02:00
Przemo Firszt d7ae64fb45 FEM: Use local variable to avoid long strings in write_material_element_sets
print material_object['Object'].Name, ':  ', material_object['Object'].Material['Name']

becomes this:

print mat_obj_name, ':  ', mat_name

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:28:57 +02:00
Przemo Firszt a99a897ae8 FEM: Rename variables f->elem, inpfile->f
The reason behind that change is that auxiliary variables,
like a file handle, should not be too visible. inpfile was
a good description, but we're handling only one file and there
is no need to use a descriptive variable name for it in every function.
It's enough that is used in write_calculix_input_file

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-05-01 17:28:39 +02:00
wmayer dd2b39ddd6 + fixes #0002075: Analysis of FreeCAD by PVS-Studio static analyzer 2015-05-01 16:56:31 +02:00
wmayer d8f63bcfd1 + fix broken brush selection 2015-05-01 02:08:06 +02:00
wmayer 6b6070281e + whitespacee/typo fixes 2015-04-30 23:16:57 +02:00
wmayer 11239b034c + always keep digits at end when using copyObject, remove deprecated third parameter 2015-04-29 16:33:20 +02:00
wmayer 1811795e41 + fix build failure for zipios++ from Fedora 2015-04-29 10:31:10 +02:00
Przemo Firszt f5874a74e4 FEM: Split inp write_calculix_input_file into functions
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:19 +02:00
Przemo Firszt 30a69a5797 FEM: Make sure Young's modulus is written in MPa
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:18 +02:00
Przemo Firszt ab26d7fd50 FEM: Replace invalid General_description with Description
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:17 +02:00
Przemo Firszt 7036d46bf2 FEM: ccxInpWriter shouldn't do any validation or guessing
Also, there is no need to print material parameters to the console.
User can see that info in dialog box, in .inp file and it's also printed
to console after material has been set.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:17 +02:00
Przemo Firszt 5e48d624e4 FEM: Make sure Edit/Run buttons stay disabled if ccxInpWriter didn't generate .inp file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:16 +02:00
Przemo Firszt ed8267643b FEM: Cleaning ccxInpWriter
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:15 +02:00
Przemo Firszt b61bb54b78 FEM: General_name is invalid since f96f319986
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:14 +02:00
Przemo Firszt c9a54019aa FEM: Reduce femConsole noise
Showing ccx output during short colculations doesn't make any sense.
During long calculations user is flooded with messages, that ccx
produced empty output.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:14 +02:00
Przemo Firszt 9f7728573d FEM: Remove multiple empty lines produced by ccx before sending to FEM console
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:13 +02:00
Przemo Firszt bdfe2bafda FEM: Always scroll FEM console to the bottom after adding new message
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:12 +02:00
Przemo Firszt cd4e71eadd FEM: Typo/white space fix
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:12 +02:00
Przemo Firszt 294939f471 FEM: Rename CalculixLib to ccxFrdReader
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:11 +02:00
Przemo Firszt d6b2ae8096 FEM: Move .inp writer to InpWriter.py file
Suggested by: bernd
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:10 +02:00
Przemo Firszt 42bc0b57f8 FEM: Remove never used saveMat function
That function won't be used as there is a plan to merge material
handling with Arch wb and Arch wb already has material editor.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:09 +02:00
Przemo Firszt af4ad9059a FEM: Remove never used colorValue function and FemLib.py file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:08 +02:00
Przemo Firszt c6d1052f1f FEM: Force showing Youngs modulus in MPa
That commit fixes inconsistent behaviour of Young's modulus input field
units in FEM material dialog window.

Reported-by: sgrogan
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:08 +02:00
Przemo Firszt efcfd10a56 FEM: Remove empty python file added with commit 2818bc4ddf
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:07 +02:00
Przemo Firszt 79caef00cb FEM: Fix typo
Reported-by: dubstar-04
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-27 21:33:06 +02:00
Yorik van Havre 8d46ebc405 Removed obsoleted README files - fixes #1974 2015-04-27 11:15:36 -03:00
wmayer 56ef3b56ec Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-26 22:17:58 +02:00
wmayer badfa3ad17 + unit test for PropertyEnumeration 2015-04-26 22:17:32 +02:00
Yorik van Havre d449cab279 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-26 17:11:27 -03:00
Yorik van Havre 69b213b7e5 Arch: Fixed missing cmake entries in last commit 2015-04-26 17:10:52 -03:00
wmayer c84ce15054 + preserve current index when setting enumeration 2015-04-26 22:10:40 +02:00
Yorik van Havre 02f938ebdf First groundwork on Arch Schedule tool 2015-04-26 13:57:36 -03:00
wmayer baf0dc0524 + fix broken unit test 2015-04-25 21:58:41 +02:00
Ian Rees 74c9a3dc4e Now with more Property properties! 2015-04-25 23:43:15 +12:00
wmayer 070198ecf2 + fix gcc build failure 2015-04-25 10:21:32 +02:00
Ian Rees f1b75dbe29 Refactored PropertyEnumeration 2015-04-24 23:33:33 +02:00
wmayer 67c4dcdf70 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-24 21:46:19 +02:00
wmayer 2a3edfcd84 + FEM: Add icon to command 2015-04-24 21:45:34 +02:00
Yorik van Havre c692d6e136 Arch: IFC importer can now recreate extrusions
By enabling the setting in IFC preferences, the IFC
importer can now detect if an input shape is a normal
extrusion, and create the object as a Part::Extrusion.
2015-04-24 16:30:38 -03:00
Yorik van Havre 9967bbe297 Drawing: Symbols can now contain editable texts 2015-04-23 23:13:58 -03:00
wmayer 4db69850fb + FEM: reimplement function to create FEM mesh from shape 2015-04-23 23:36:05 +02:00
wmayer ec96217335 + FEM: cleanup of unused dialog 2015-04-23 23:11:47 +02:00
Przemo Firszt 7ec585ec18 FEM: Change Start Calculations shortcut to S, C
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:05:44 +02:00
Przemo Firszt a4429c9ea8 FEM: Change Show Results shortcut to S, R
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:05:27 +02:00
Przemo Firszt 6ba642a3cc FEM: Change New Analysis shortcut to N, A
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:05:06 +02:00
Przemo Firszt e6d7b7e586 FEM: Change Mechanical Material shortcut to M, M
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:04:50 +02:00
Przemo Firszt 249c2641e0 FEM: Change order of FEM toolbar items
Suggested by wmayer

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:04:31 +02:00
Przemo Firszt f3b33f52e6 FEM: Reset min/max/avg to the initial state after user selected None
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:04:09 +02:00
Przemo Firszt 31a263ed89 FEM: Show displacement/stress nicely formatted and with proper units
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:03:44 +02:00
Przemo Firszt bf1ffb612f FEM: Rename min/max to avoid unintentional built-in function overload
min/max are python build-in functions, so we shouldn't use them as variable names

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:03:26 +02:00
Przemo Firszt dd3c7f1bfb FEM: Fix white spaces
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:03:04 +02:00
Przemo Firszt 129cc88b0b FEM: Ignore unicode conversion errors
Solution suggested by shoogen
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:02:42 +02:00
Przemo Firszt c5850e510a FEM: Cut material name to 80 characters
CalculiX documentation tells that maximum alowed material name length
is 80 characters, so we have to respect that. Also ccx quietly fails if
that limit is not honoured.

Reported-by: bernd
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:02:22 +02:00
Przemo Firszt 1e026ac477 Material: Use repr instead of backticks
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:02:02 +02:00
Przemo Firszt 4f36439028 Material: Fix white space errors in Material.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:01:39 +02:00
Przemo Firszt f96f319986 FEM: Change default behaviour of ConfigParser used for materials
ConfigParser changes option capital letters in keys to small letters.
That commit changes it to generate verbatim keys as read from FCMat
files. Also Section names are no longer used to generate material
dictionary.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:01:18 +02:00
Przemo Firszt 9b2f2b15bc FEM: Change way of handling combobox with FEM results
Identification of selected result item is no longer based
on the item string, but on a separate userData. This method
is language agnostic.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 17:00:56 +02:00
Przemo Firszt d548490a2b FEM: Clean white spaces in MechanicalAnalysis.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 16:59:52 +02:00
Przemo Firszt f482dc2383 FEM: Clean imports in MechanicalAnalysis.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 16:59:30 +02:00
Przemo Firszt 957f723782 FEM: Make sure .inp doesn't contain force values that crash ccx
ccx crashes when a force has too many digits like this:
FemConstraintForce,2,1.5966711853290134e-18
but it's OK with that format:
FemConstraintForce,2,1.5966711853e-18

An example of ccx error:
*ERROR reading *CLOAD. Card image:
FEMCONSTRAINTFORCE,3,1.5966711853290134E-18

This commits adds formatting to make sure the numbers are within ccx
limits.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-23 16:58:57 +02:00
wmayer 13b8d323b2 + FEM: Improve drag and drop for FEM analysis object 2015-04-23 13:31:14 +02:00
Yorik van Havre bf32404975 added new set of Drawing templates - fixes #2065 #2043 #2005 2015-04-22 19:01:55 -03:00
wmayer f460cec308 + FEM: Support drag and drop for analysis object 2015-04-22 23:24:43 +02:00
wmayer bf2266aee3 + hide input shape after creating fem object, give feedback on wrong selection for nodes set 2015-04-22 22:45:07 +02:00
Bernd Hahnebach f4f7759bba FEM: CalculiX input file, possibility to write more than one material object 2015-04-22 15:28:37 -03:00
wmayer 02b84611b2 + extend Inventor builder, project curve on mesh 2015-04-22 17:15:49 +02:00
wmayer 197aa0c85c + fix bug in read-only InputField, minor Utf-8 issue in meshing dialog 2015-04-22 14:01:27 +02:00
Yorik van Havre bab894b775 Arch: Better output of ArchVRM renderer 2015-04-20 18:34:40 -03:00
Yorik van Havre 01480a174a Workaround for issue #1963 - Search for templates in userAppData/Templates folder 2015-04-20 12:45:43 -03:00
wmayer 01768b70e7 + FEM: remove useless error message 2015-04-20 11:35:40 +02:00
wmayer 9dfb87d227 + do not translate units 2015-04-20 10:48:06 +02:00
wmayer 225fce9604 + do not translate units 2015-04-19 23:41:27 +02:00
Yorik van Havre 4d630dbc32 Arch: misc improvements to materials and IFC
* Improved IFC export of curved surfaces
* Better icon for materials group
* Fixes in IFC export of materials
2015-04-19 16:34:36 -03:00
wmayer bba2dd581b + update Debian packaging files 2015-04-19 13:42:02 +02:00
wmayer f12a26b5fb + remove broken command from FEM workbench 2015-04-18 22:06:55 +02:00
Yorik van Havre 3e82f69ca5 Arch: Enabled materials in IFC import & export 2015-04-17 19:43:54 -03:00
wmayer 017e0f38d1 + fixes #0001998: For 32 px and 48 px the icons with a submenu in toolbars are not display at the good size 2015-04-17 23:16:28 +02:00
wmayer 59e45e0ae9 + use .dylib for normal shared libraries under MacOSX 2015-04-17 18:13:51 +02:00
Przemo Firszt 943ded5774 FEM: Fix typo in fem_console_message name
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 987dddfc78 FEM: Fix rare crash related to the date of compilation of ccx
Printing FEM console message could fail if ccx was compiled in March
and standard output contained double dotted a.
"You are using an executable made on Mi 4. Mär 19:49:02 CET 2015"

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 4b56d3d406 FEM: Fix typo. Rename MathObject to MaterialObject
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 35c5de0782 FEM: No need to check length, empty list evaluates to False
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 25c18729e1 FEM: Disable "open editor" and "run ccx" buttons.
This commit moves checking prerequisites to function. The function
is called before writing .inp file to make sure all required objects
are included in the analysis. "open editor" and "run ccx" buttons are
if check_prerequisites runs successfully.

Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 2d90d39cc3 FEM: Make sure cursor gets restored if write_calculix_input_file fails
Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt d3c7270031 FEM: Fix typos
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt ac5fe442dc FEM: Group all helper functions together
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt b6ea746fa2 FEM: Rename chooseMat to choose_material
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 3066e6b3d0 FEM: Use built-in None material if there was no previous material
Adding material was using by default transient None material that
has no properties assigned. If use accepted that type of material
an attempt to write CalculiX input file was ending up with a crash.
Using built-in None material prevents that situation.

Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 6437beaec1 FEM: Use default True value for material dirs
Defaulting to False was causing problems during migration. The default
checkbox of linked FEM preferences is True, but for the first time users
there was nothing stored in UseBuiltInMaterials, UseMaterialsFromConfigDir
and UseMaterialsFromCustomDir, so the materials were not showing up in
the material ComboBox.

Reported-by: wmayer
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 76aa89b536 FEM: Catch ccx errors and print to FEM console in red
Code by wmayer

http://forum.freecadweb.org/viewtopic.php?f=18&t=10514&p=84921#p84901
2015-04-17 10:51:56 +02:00
Przemo Firszt 2acfadfeef FEM: Change way of converting ccx output to unicode
Previous method was prone to UnicodeDecodeError. The try-catch for
UnicodeDecodeError stays in as additional safety net.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Przemo Firszt 663771f0a4 FEM: Sort materials within each category
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-17 10:51:56 +02:00
Yorik van Havre 6750127a05 Arch: Added materials support 2015-04-15 22:08:54 -03:00
Ian Rees f068e723ea Remember last tab selected in PropertyView 2015-04-15 09:12:30 +12:00
wmayer 38ca5341a6 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-14 16:34:11 +02:00
wmayer 0c1fb8e4d8 + delay checking for ccx path, handle exceptions 2015-04-14 16:33:44 +02:00
Przemo Firszt 84467808a4 FEM: Use get_material_data in print_mat_data function
get_material_name provides material name in a safe way, so there is
no need to check in General_name exists in material definition

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:46 +02:00
Przemo Firszt 9eb6cf7480 FEM: Clean code to remove space-after-comma flake8 warning
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:45 +02:00
Przemo Firszt abefd40bb7 FEM: Add Preferences option to hide materials from user defined directory
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:45 +02:00
Przemo Firszt 1d5b4709fe FEM: Add Preferences option to hide materials from .FreeCAD/Materials directory
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:44 +02:00
Przemo Firszt 32a51db481 FEM: Add Preferences option to hide built in materials
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:43 +02:00
Przemo Firszt 956e5f0da0 FEM: Remove self.params
It doesn't make sense to pull preferences in __init__ for later use as
they change dependin on user action.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:43 +02:00
Przemo Firszt 5040266320 FEM: Add message about reverting material after user clicked Cancel button
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:42 +02:00
Przemo Firszt 9205db4b77 FEM: Fix problem with lost values after editing material properties
Now a valid value is stored immediately into object material.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:41 +02:00
Przemo Firszt 75fcae04b9 FEM: Compare material using all properies and handle non-local materials
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:41 +02:00
Przemo Firszt c091b87459 FEM: Rename comboBox_MaterialsInDir to cb_materials
The combo box no longer stores materials from just one dir, so name
needs to be changed

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:40 +02:00
Przemo Firszt 8113463e1e FEM: Import all materials in init instead of on-demand import
On-demand import is no longer good enough as we have 3 different
material directories and materials may have non-unique names.
A material is now identified by a full file path.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:39 +02:00
Przemo Firszt 343225dcc2 FEM: Show material description below combo box
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:39 +02:00
Przemo Firszt 97f5f76433 FEM: Add function for adding materiales from a directory
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:38 +02:00
Przemo Firszt 7cb4df59f7 FEM: Use chooseMat directly set set initial value for material
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:37 +02:00
Przemo Firszt 9a9f7e64a5 FEM: Add icons to materials
Add icons to distinguish where the material is from. FreeCAD icon for
build-in materials, notmal material icon for materials from user
preferences directory which is "~/.FreeCAD/Materials" on linux or
from an user defined location defined in FEM preferences.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:36 +02:00
Przemo Firszt f7fd04aa2b FEM: Add option to define custom material directory
That commit also tidies up FEM preferences, so all file
choosers have the same width

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:36 +02:00
Przemo Firszt 0039ea9e72 FEM: Rename dirname to sytem_mat_dir
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:35 +02:00
Przemo Firszt 54ae984650 FEM: Read materials from user settings directory
That commit also adds python function getUserAppDataDir that calls
Application::getUserAppDataDir()

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:34 +02:00
Przemo Firszt b7bb4346da FEM: Fill default ccx binary location in Preferences
ccx path is filled for linux and windows if it was empty.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:33 +02:00
Przemo Firszt bf179d9f78 FEM: Add option to define ccx path in Preferences
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-14 15:25:32 +02:00
Sebastian Hoogen 7ddd9d2ce0 check BoundingBox before calling distToShape
to find intersecting edges. issue #2050
2015-04-14 10:12:04 -03:00
wmayer f6638d49ce + improve abaqus export 2015-04-14 13:33:20 +02:00
wmayer 0e91902e74 + move to Qt's built-in search system for icon resources 2015-04-14 11:37:24 +02:00
wmayer 2dc1890fd2 + fix rendering problems for FEM elements 2015-04-13 22:11:27 +02:00
wmayer 1c79de55ed + workaround for limit of length of file names 2015-04-13 18:23:30 +02:00
wmayer 618192fca5 + fix critical memory leak 2015-04-13 17:24:54 +02:00
wmayer f53fd0fe90 + allow PNG format with POV-Ray 3.7 on Windows 2015-04-13 11:12:14 +02:00
wmayer 0c0365bb49 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-13 10:33:39 +02:00
wmayer d9b6007722 + fix wrong template path for Raytracing/Lux project 2015-04-13 10:33:10 +02:00
Yorik van Havre a7c346606f Material: Fixed bug in cmake file from commit 6685ae0 2015-04-12 19:21:32 -03:00
wmayer 3e1e5974f0 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-12 18:39:27 +02:00
wmayer 8991b9e04b + add Document::sendMsgToFirstView, fix memory leak 2015-04-12 18:39:01 +02:00
Yorik van Havre 6685ae0142 Material: Added prefix to steel material cards 2015-04-12 13:31:49 -03:00
wmayer 52db9a6cff + set shape color when reading STEP with colors 2015-04-12 12:43:21 +02:00
wmayer 708f6665e6 + fixes #0001831: FreeCAD can start only once 2015-04-12 02:02:30 +02:00
wmayer 2a5659c36b Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-04-11 22:30:36 +02:00
wmayer 8476bab7dc + fixes #0001963: Only write needed user data in FCSTD file if any. 2015-04-11 22:30:11 +02:00
Yorik van Havre 5c079f8da7 Arch: small fix in IFC explorer 2015-04-11 14:58:33 -03:00
wmayer 00daa1cbd2 + fixes #0001989: 'Open recent' not saved until exit. 2015-04-11 19:04:31 +02:00
wmayer 4e54841a75 + fixes #0002047: Don't register recent files which can't be opened 2015-04-11 17:34:46 +02:00
wmayer c62319d2d9 + make XML parser more robust against unexpected structure 2015-04-11 13:11:12 +02:00
wmayer 9ea9980b2c + fix bad choose of limit 2015-04-11 01:06:03 +02:00
Bernd Hahnebach 56b15fb690 FEM: CalculiX file, boundaries one line for each axis 2015-04-11 00:17:08 +02:00
Bernd Hahnebach 08be917054 FEM: cheange some Comments in CalculiX input file 2015-04-11 00:16:51 +02:00
wmayer 64b83139c7 + fix highlighting of words with numbers 2015-04-10 23:38:29 +02:00
wmayer 1c79112f6e + handling of undercore in calltips window 2015-04-10 19:36:30 +02:00
wmayer b3cbf2b3da + fix Part.__sortEdges__, check for object type in Part.Wire 2015-04-10 18:25:31 +02:00
Yorik van Havre 0c32b1b0ec Draft: make sure normal is consistent for whole path in PathArray 2015-04-10 12:10:28 -03:00
Yorik van Havre 7a096acccd Arch: Objects with same colors are now exported to IFC with same IfcSurfaceStyle 2015-04-09 21:07:44 -03:00
Yorik van Havre 1f47d2cac0 Arch: added DAE importer patch - fixes #2044 2015-04-09 20:17:37 -03:00
wmayer e18796efc5 + fix crash of ccx, use darker green for ccx output, fix typos 2015-04-09 23:26:06 +02:00
Ian Rees 4024f46677 Expands list of mesh formats for import/export 2015-04-09 22:15:28 +02:00
Sebastian Hoogen 6a6a3d3bd0 use multiFuse in Draft/Array issue #1971 2015-04-09 20:19:13 +02:00
Przemo Firszt c774316642 FEM: Unify access rights for FEM svg images
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:11 +02:00
Przemo Firszt 9731fc4e4d FEM: Replace hardcoded icon with a normal image file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:11 +02:00
Przemo Firszt 03e5bb55a4 Material: Change PLA material description
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:10 +02:00
Przemo Firszt 6c3e3b740b Material: Use MPa for Young's modulus in material definitions
Scientific notation removed.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:10 +02:00
Przemo Firszt 72b73d8208 Base: Fix pressure unit problem in internal unit schema
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:09 +02:00
Przemo Firszt be1240a977 FEM: Change Young's modulus limit
2000 was way too low and it was causing some unxepected behaviour for
Young's modulud over 2000 kPa

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:09 +02:00
Przemo Firszt 3a7f48c632 FEM: Fix typo
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:08 +02:00
Przemo Firszt ab2f1c5d1d FEM: Enable displacement related elements on "Show" only
Displacement related elements (factor, slider max and the slider itself)
are now only active when "Show" is selected. Previously they were active
even when "Show" wasn't checked and it was potentially confusing for the
user as nothing was changing when chacnging slider settings.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:08 +02:00
Przemo Firszt 8489a014d1 FEM: replace vertical factor scroll bar with a horizonal one
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:07 +02:00
Przemo Firszt 54bb4e297e FEM: Add "None" and simplify material setting
The "-->choose Material" has been replaced with a not defined material.
That makes setting/retrieving material to/from the object much easier
and allows user to have a "not defined" material. Previously it wasn't
possible to change i.e. form Steel to "not defined".

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:06 +02:00
Przemo Firszt aec082639f FEM: Clean unused import in MechanicalMaterial.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:06 +02:00
Przemo Firszt 65396bc95b FEM: Comment out not yet used saveMat function 2015-04-09 19:45:05 +02:00
Przemo Firszt 18aad09d0d FEM: Replace spinBox_young_modulus with input_fd_young_modulus
spinBox_young_modulus variable is not Gui::SpinBox, but Gui::InputField

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:05 +02:00
Przemo Firszt 56bf10afef FEM: Replace duplicated code with print_mat_data function
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:04 +02:00
Przemo Firszt 8de8b991a5 FEM: Replace deprecated has_key with in
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:04 +02:00
Przemo Firszt 135cfbd80f FEM: Remove unused local variable
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:03 +02:00
Przemo Firszt 157a1d8e77 FEM: Fix spaces around =/+/: and brackets
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:03 +02:00
Przemo Firszt 5a1249dc3b FEM: Fix white space errors
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:02 +02:00
Przemo Firszt 6bfd683dcf FEM: Clean unused imports in MechanicalMaterial.py
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:02 +02:00
Przemo Firszt 1ff82e48c6 FEM: Fix copyright date
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:01 +02:00
Przemo Firszt 0f9bcc2f84 FEM: Replace deprecated backticks with repr
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:01 +02:00
Przemo Firszt 7b01cd6832 FEM: Replace "!=" with "is not" when comparing to None
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:00 +02:00
Przemo Firszt 7030aa7482 FEM: Fix white space errors
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:45:00 +02:00
Przemo Firszt 835228ef34 FEM: Fix spaces around =/+/: and brackets
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:44:59 +02:00
Przemo Firszt 40e8f5b020 FEM: Clean unused imports
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:44:58 +02:00
Przemo Firszt 3b46c4e94a FEM: Fix copyright date
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:44:57 +02:00
Przemo Firszt 1af11d9db7 FEM: Rename OutStr to more descriptive fem_console_message
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:44:57 +02:00
Przemo Firszt b149ba0288 FEM: Make CalculiX execute error message red
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-09 19:44:56 +02:00
Yorik van Havre fbbc9e21a9 Draft: Improved behaviour of Clone tool when dealing with Arch objects 2015-04-08 21:00:43 -03:00
Yorik van Havre 5d0bc520b9 Gui: Added entry to Selection View's context menu, to use selected objects in the python console 2015-04-08 14:08:14 -03:00
Yorik van Havre 892b7ae509 Arch: Misc improvements for IFC workflow
* Added utility to make non-parametric Arch component
* Ability for all Arch components to be a clone of another Arch component of same type
* Modified the Draft Clone tool to produce Arch Clones if applicable
* Fixed Arch Roofs so they can be based on a solid shape like other Arch objects
* Ability to change the Root element to be imported in IFC preferences
* Ability to import IFC files also as compounds, Part shapes or non-parametric Arch objects
* Added an "only" parameter to importIFC.open() to import only a certain object ID.
* Ability to read colors (IfcSurfaceStyle) from IFC objects
2015-04-08 12:34:48 -03:00
DeepSOIC 694b0339fd GestureNav: bug fix (tilting) + kill messagebox
Fixed a bug where starting tilting with LMB+RMB with LMB in sketcher
caused odd behavior.
No more messagebox upon hitting H key when the cursor is over nothing
(replaced with a warning). The messagebox was very annoying when trying
to hunt a point with touch input.
2015-04-07 00:57:24 +03:00
DeepSOIC 8ba5f73c1a GestureNav: bug fix (gesture lockup in sketcher)
Navigation by gestures didn't work after double-clicking a constraint in
sketcher to edit a value. This was probably caused by the last mouse
button release event not reaching the viewer.
2015-04-07 00:57:23 +03:00
DeepSOIC 963b993abc Gestures: fix running on win XP
Potential fix, by dynamically linking SetGestureConfig
2015-04-07 00:57:22 +03:00
wmayer 176f3e6057 + use correct function to get resource directory 2015-04-05 18:30:35 +02:00
wmayer 960be3c809 + fix memory leak in toBiArcs 2015-04-05 17:19:04 +02:00
wmayer 79de781304 + remove leftover 2015-04-05 16:50:58 +02:00
wmayer 1d1e71b52f + integrate biarcs algorithm 2015-04-05 14:10:03 +02:00
wmayer d3af1ea85a + fix compiler warning 2015-04-04 14:09:00 +02:00
wmayer 453eb18abb + start external editor without blocking GUI 2015-04-03 17:55:51 +02:00
Przemo Firszt d13c279d5a FEM: Add preferences dialog
This patch add FEM preferrences dialog. There is currently only
one option to define if internal or external editor should be used to
open CalculiX input .inp files. Disabling internal editor allows to
define path to external editor.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-04-03 08:07:28 +02:00
wmayer b36c34b105 + fixes #0002033: boolean failure, model refine 2015-04-03 07:39:17 +02:00
wmayer 32688a636b + check for Win7 to activate gesture support 2015-04-01 21:56:56 +02:00
wmayer c519989ec0 + apply patch from Debian to fix build failure of KDL with clang 2015-04-01 16:15:29 +02:00
Ian Rees ccfaa56b31 Improves build on MacOS with Homebrew or MacPorts
Squashed commit of the following:

commit e158a2049b922cead90cee4a9d3814093db8d00d
Merge: e7c5c06 d545f5b
Author: Ian Rees <ian.rees@gmail.com>
Date:   Wed Mar 25 17:08:56 2015 +1300

    Merge branch 'mac-app-bundle' into macports-build-1

commit d545f5b0de0efa6a0fd020ac98bb6809d9254019
Author: Ian Rees <ian.rees@gmail.com>
Date:   Thu Mar 19 22:30:20 2015 +1300

    Minor fixes to Mac application bundle creation

commit e7c5c0630b47e89fc719259f3d81be724627f915
Author: Ian Rees <ian.rees@gmail.com>
Date:   Thu Mar 19 16:35:34 2015 +1300

    Report error if no OpenCasCADe found

commit 976b51c13a1619acf66b9d4fad5594fee292aa76
Author: Ian Rees <ian.rees@gmail.com>
Date:   Thu Mar 19 16:30:47 2015 +1300

    Detects OCE automatically on Homebrew and MacPorts

commit 1cc477f77f388f2ccb26f3884320819f8cb33249
Author: Ian Rees <ian.rees@gmail.com>
Date:   Tue Mar 17 15:00:34 2015 +1300

    Find PySide and Shiboken automagically on MacPorts

commit 8bf2ebf7397a1c8c4b1b6f1d97e303f335ab47d7
Author: Ian Rees <ian.rees@gmail.com>
Date:   Mon Mar 16 23:05:35 2015 +1300

    Finds the Python include dir and library on OSX

commit 8bba9b2c78cfe65d7c295c4c99f0a176e1281539
Author: Ian Rees <ian.rees@gmail.com>
Date:   Mon Mar 16 17:31:43 2015 +1300

    Detects Python executable in MacPorts or Homebrew

commit 349a2e0e5c4d370c331bdb54d80d8f4323db8a6b
Author: Ian Rees <ian.rees@gmail.com>
Date:   Mon Mar 16 08:25:16 2015 +1300

    Missing correct Python lib is error on cmake-ing

commit 1625fe7c1c7fb2d944b04d93be8cf90d5c829be9
Author: Ian Rees <ian.rees@gmail.com>
Date:   Sun Mar 15 21:06:08 2015 +1300

    Find PySide's UIC and RCC tools properly on MacPorts
2015-04-01 14:40:34 +02:00
wmayer ebb1ca3b36 + improve whitespaces 2015-04-01 13:17:26 +02:00
Torsten Sadowski 75070b1810 Builds and runs with or without 3Dconnexion.framework on Mac
Moved on top of a clean master
2015-04-01 12:30:07 +02:00
Peter Lama 6c42e558e2 + get version number from Version.h 2015-04-01 12:02:51 +02:00
wmayer bc9b8bcf19 + support .inp file format 2015-04-01 11:09:46 +02:00
wmayer 5b27b3194e tmp. disable gesture support 2015-03-31 23:44:23 +02:00
wmayer 8e0110a18e + fix various things 2015-03-31 23:08:12 +02:00
DeepSOIC 4f5747ebef New navigation style: GestureNavigationStyle 2015-03-31 21:49:01 +02:00
DeepSOIC 7085e1ec0c Gestures: inventor touch events and device 2015-03-31 21:49:01 +02:00
DeepSOIC 7f0ca58154 Gestures: tuning windows to enable rotates and switch off horz/vert stickiness of pans 2015-03-31 21:49:00 +02:00
DeepSOIC c0d15db47c Gestures: subscribe 3d view to recieve gestures 2015-03-31 21:49:00 +02:00
DeepSOIC 77ef990fa7 Gestures: custom Windows gesture recognizer
Translates native Windows pinch and rotate gestures into Qt's pinch
gestures.
2015-03-31 21:49:00 +02:00
wmayer 862e65df6c + build failure 2015-03-31 13:00:42 +02:00
wmayer 1d4de73415 + support context-menu in Python view providers 2015-03-31 11:32:43 +02:00
wmayer 9ce46db813 + extend ActionFunction and use in mesh view provider 2015-03-31 01:02:16 +02:00
wmayer bbb3e3f459 + fix build failure with gcc 2015-03-30 23:16:28 +02:00
wmayer ae584e8ec8 + implement mechanism to connect QAction signal with class method 2015-03-30 23:07:34 +02:00
wmayer 018854360d + implement mechanism to connect QAction signal with class method 2015-03-30 23:06:35 +02:00
wmayer 90b5d64831 + remove platform check 2015-03-30 16:36:40 +02:00
wmayer 30098b62e3 FEM: improve Abaqus syntax highlighter 2015-03-30 15:28:08 +02:00
wmayer ff774748cd + FEM: get nodes by vertex 2015-03-30 11:45:35 +02:00
wmayer f84a150bfd + choose consistent C++ and Python method names
+ fix typos
+fix whitespaces
2015-03-30 10:42:14 +02:00
Bernd Hahnebach a15ea4ca18 Fem: add Support for loads and supports on edges to CalculiX file 2015-03-30 10:24:38 +02:00
Bernd Hahnebach e4c2421350 Fem: added Support for more than one Force- and FixedObject in CalculiX file 2015-03-30 10:23:42 +02:00
wmayer dadc87eff8 + fixes #0002029: VRML inline ignored 2015-03-30 02:23:49 +02:00
wmayer 995de944c8 + fixes #0002029: VRML inline ignored 2015-03-29 23:35:39 +02:00
wmayer 88ef0b58d9 + syntax highlighter for Abaqus, show short filename on tabs 2015-03-28 21:50:01 +01:00
Przemo Firszt 18e4fdf5c2 + FEM: Use existing internal editor for inp files 2015-03-28 19:33:11 +01:00
wmayer bf7bc3532e Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-03-28 17:40:36 +01:00
DeepSOIC 89d0a7a176 Sketcher: bugfix: disallow opening when geometry types changed 2015-03-28 17:35:10 +01:00
DeepSOIC 3e6eb430fa Sketcher: small asserts cleanup 2015-03-28 17:35:10 +01:00
DeepSOIC 94c26629c0 Sketcher: add checks for null pointers
Made throws on null pointers.
2015-03-28 17:35:10 +01:00
DeepSOIC 5d9b7a4e03 Sketcher: fix repr string for symmetric constr. 2015-03-28 17:19:37 +01:00
wmayer 30e4eae4aa + fix gcc build failure 2015-03-28 16:35:27 +01:00
wmayer f3cd3e4ce8 + fixes #0002029: VRML inline ignored 2015-03-28 14:51:03 +01:00
wmayer 436749f864 + fixes #0002029: VRML inline ignored 2015-03-27 16:42:14 +01:00
Bernd Hahnebach b4b0ed5c44 Fem: fix: system() is evaluated instead of calling it 2015-03-26 19:38:10 +01:00
wmayer f6d50e6f33 + disable lighting effect of axis cross 2015-03-23 21:08:28 +01:00
wmayer 70a1124a1d + re-enable check for active window for spaceball events 2015-03-23 19:44:04 +01:00
blobfish eba335c615 Part: ModelRefine: catch bspline isEqual exception 2015-03-22 18:43:39 +01:00
wmayer 5ff38ba7d5 + add methods to get GProps from curves and surfaces 2015-03-22 18:39:49 +01:00
wmayer 0a4b08fcb6 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-03-22 12:13:14 +01:00
wmayer 1719f4269a + check if directory exists when trying to save image 2015-03-22 12:12:42 +01:00
Yorik van Havre d67d9603c2 Better PDF generation script 2015-03-21 17:45:08 -03:00
wmayer f87fbe7e2a Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-03-21 19:56:00 +01:00
Sebastian Hoogen db13fbb7b3 add angularDeflection property to ViewProvider
issue #1868
2015-03-21 19:27:43 +01:00
Yorik van Havre 6a2a20f64b Draft: Fixed children being moved together with section planes 2015-03-21 13:23:23 -03:00
wmayer 05bc4d13e1 Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code 2015-03-21 16:57:36 +01:00
Yorik van Havre 5057f28a49 Drawing: Added SVG pattern generation module 2015-03-21 12:08:05 -03:00
Yorik van Havre 103ee9943d Arch: Added clickable links in IFC explorer 2015-03-21 12:08:05 -03:00
Yorik van Havre 6fb4a7d6f4 Arch: Added more properties needed for green buildings 2015-03-21 12:08:05 -03:00
Yorik van Havre df074d117e Draft: Fixed arc direction in SVG projections 2015-03-21 12:08:05 -03:00
Yorik van Havre 77f6684dfe Arch: Enabled section filling in Arch drawing views 2015-03-21 12:08:05 -03:00
Yorik van Havre 2afea6c661 Arch: Allow section planes to clip the 3D view 2015-03-21 12:08:05 -03:00
Yorik van Havre de4fbb94ef Arch: added space types 2015-03-21 12:08:05 -03:00
Yorik van Havre a6206196f6 Arch: added bimserver and git utilities 2015-03-21 12:08:05 -03:00
Ian Rees bd28c52fca Warn user if they cascade/tile windows on Mac 2015-03-21 15:59:44 +01:00
Ian Rees 2de5c0f59c Doxygen ignore _rc.py files 2015-03-21 15:55:48 +01:00
Sebastian Hoogen 089174c297 test for default color from preferences in OpenSCAD/Explode command 2015-03-21 13:29:33 +01:00
Sebastian Hoogen 1846087723 improvements in exportDRAWEXE
fix Draft._clone output
export Shape2DViews
export Part::MultiFuse with single boolean operation like done in c2ce8f5eba
make DRAWEXE ouput more readable
* omit unessary parameters of spheres, cylinders, cones and tori
* denormalize the rotation axis in placements
* use the extension .tcl for the output
2015-03-21 13:29:32 +01:00
Sebastian Hoogen 16c1dbd25d document the convention used for Euler angles (XY'Z'')
in the Placement dialog and the docstrings of the Rotation python class.
fixes #2007
2015-03-21 13:29:32 +01:00
Sebastian Hoogen 01b491b16e use shape.proximity(s) to test for overlapping faces in CSG import 2015-03-21 13:29:31 +01:00
Sebastian Hoogen 565a875365 add shape.proximity(shape) 2015-03-21 13:29:30 +01:00
Sebastian Hoogen 89117e2c6d set FileName property to transient
in order no to leak information in the FCStd file
2015-03-21 13:29:29 +01:00
wmayer 77fe619fa9 + fix layout in DlgReportView page 2015-03-21 13:00:57 +01:00
Przemo Firszt a53f6818b4 FEM: Add description to massage about CalculiX binary
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:04:11 +01:00
Przemo Firszt ec27cbc1c6 FEM: Add printCalculiXstdout function
That non-critical part was quite often silently crashing with
UnicodeDecodeError and as a side effect FreeCAD wasn't loading perfectly
valid CalculiX result file. In long run that function should be replaced
with a write-to-log counterpart and the CalculiX stdout should be shown
to the user only upon request.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:03:56 +01:00
Przemo Firszt d693051f14 FEM: Add function to show CalculiX state changes
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:03:43 +01:00
Przemo Firszt e0ed154996 FEM: Warn user about not implemented Loads/Supports
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:03:27 +01:00
Przemo Firszt 0ed9b18367 FEM: Link exisitng calculixError procedure with error signal
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:03:05 +01:00
Przemo Firszt 47b88e47fb FEM: Add message to indicate end of writing CalculiX input file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:02:52 +01:00
Przemo Firszt ea640ea104 FEM: fix typos
machanical -> mechanical
Van Mises -> Von Mises

http://en.wikipedia.org/wiki/Von_Mises_yield_criterion

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:02:36 +01:00
Przemo Firszt 41539d672b FEM: Fix cursor error
FEM wb was throwing errors:
X Error: BadCursor (invalid Cursor parameter) 6
  Major opcode: 2 (X_ChangeWindowAttributes)
  Resource id:  0x3
X Error: BadCursor (invalid Cursor parameter) 6
  Major opcode: 2 (X_ChangeWindowAttributes)
  Resource id:  0x3
X Error: BadCursor (invalid Cursor parameter) 6
  Major opcode: 95 (X_FreeCursor)
  Resource id:  0x3

according to this [1] that patch should not make any change for windows
and fixes the problem on linux.

[1] https://bugreports.qt.io/browse/PYSIDE-243

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-03-21 12:02:20 +01:00
wmayer ff667115e1 + start development for 0.16 2015-03-20 14:40:14 +01:00
4046 changed files with 697240 additions and 1212141 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"phabricator.uri" : "http://pha.geofinder.eu/"
}
+3
View File
@@ -27,3 +27,6 @@ install_manifest.txt
/Mod/
/ZERO_CHECK.dir/
/build/
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/todolist.txt
/src/Tools/offlinedoc/wikifiles.txt
+3
View File
@@ -0,0 +1,3 @@
Wrn:
Err:
Cannot find icon:
Executable
+166
View File
@@ -0,0 +1,166 @@
####
# Travis-CI configuration file for FreeCAD.
#
# This build configuration will build and test FreeCAD on both Linux
# and Mac OS X. For Mac OS X, this configuration will also package
# and deploy the build to GitHub provided the following prerequisites
# are satisfied:
#
# GH_TOKEN is defined as a secure environment variable and contains a
# a valid GitHub OAUTH token with repo_deployment scope.
# NOTE: Define this env using the Travis-CI Repo Settings UI
#
# FREECAD_RELEASE: A GitHub Release with this identifier exists in the
# repo. The Travis job will deploy the OS X build to this
# GitHub release name as a release asset.
##
env:
global:
- FREECAD_RELEASE="0.16"
- DEPLOY_RELEASE=${DEPLOY_RELEASE:-$FREECAD_RELEASE}
- CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
- OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
os:
- linux
- osx
git:
depth: 800
language: cpp
before_install:
- eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
- |
case "${TRAVIS_OS_NAME}" in
"linux")
sudo apt-get update -qq
sudo apt-get install -y doxygen \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-python-dev \
libboost-regex-dev \
libboost-signals-dev \
libboost-system-dev \
libboost-thread-dev \
libcoin60 \
libcoin60-dev \
libeigen3-dev \
liboce-foundation-dev \
liboce-foundation1 \
liboce-modeling-dev \
liboce-modeling1 \
liboce-ocaf-dev \
liboce-ocaf-lite-dev \
liboce-ocaf-lite1 \
liboce-ocaf1 \
liboce-visualization-dev \
liboce-visualization1 \
libopencascade-modeling-6.5.0 \
libpyside-dev \
libqtcore4 \
libshiboken-dev \
libxerces-c-dev \
libxmu-dev \
libxmu-headers \
libxmu6 \
libxmuu-dev \
libxmuu1 \
oce-draw \
pyside-tools \
python-dev \
python-pyside \
python-matplotlib \
qt4-dev-tools \
qt4-qmake \
shiboken \
swig
#Patch the system - there is a bug related to invalid location of libs on ubuntu 12.04
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/i386-linux-gnu
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
CMAKE_ARGS=""
INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
;;
"osx")
brew update >/dev/null
if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
brew install jq
cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
prime_local_ports_cache $cacheContext
fi
brew install eigen \
freetype \
qt \
python \
boost-python \
pyside \
pyside-tools \
xerces-c \
orocos-kdl \
homebrew/science/oce \
homebrew/python/matplotlib
brew install --with-oce homebrew/science/nglib
brew install --without-framework --without-soqt sanelson/freecad/coin
brew install --HEAD pivy
#Install the 3DConnexion frameworks
if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
curl -o /tmp/3dFW.dmg -L 'http://www.3dconnexion.com/index.php?eID=sdl&ext=tx_iccsoftware&oid=a273bdbc-c289-e10d-816b-567043331c9e&filename=3DxWareMac_v10-2-5_r2142.dmg'
hdiutil attach -readonly /tmp/3dFW.dmg
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
fi
#Remove GDAL if installed because it results in non-existent dependent library exceptions
if [ -e /usr/local/lib/libgdal.1.dylib ]; then brew unlink gdal; fi
CMAKE_ARGS="-DFREECAD_USE_EXTERNAL_KDL=ON -DBUILD_FEM_NETGEN=ON -DFREECAD_CREATE_MAC_APP=ON"
INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/bin/FreeCAD"
;;
*)
echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
exit 1
;;
esac
install:
####
# Build FreeCAD with cmake options set above for each platform
##
- mkdir build && cd build && cmake ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
script:
####
# Install FreeCAD and run unit tests. Test failures will fail the build
##
- sudo make -j2 install
- ${INSTALLED_APP_PATH} --run-test 0
- ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
- sleep 10 && pkill FreeCAD
- cat /tmp/FreeCAD_installed.log
- grep --file=../.log_errors /tmp/FreeCAD_installed.log ; [ $? == 1 ] && echo "No errors from .log_errors file found in the log after start from /usr/local/bin" || ( echo "Error from .log_errors found!" && false )
after_success:
####
# Package and deploy the build to GitHub. This will only run for builds on
# master (i.e. pull requests are only built and tested but not deployed).
#
# GH_TOKEN must be set in order to deploy releases to GitHub
##
- |
if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" ]; then
brew install jq node && npm install -g appdmg
export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h --git-SHA=$(git ls-remote origin master))
export DEPLOYMENT_ARCHIVE=${VSN}.dmg
appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
gitHub_prune_assets_for_release_named $deployContext "-OSX-" 3
fi
+294 -70
View File
@@ -1,10 +1,10 @@
project(FreeCAD_trunk)
set(FREECAD_VERSION "0.15")
set(FREECAD_VERSION "0.16")
set(PACKAGE_NAME "FreeCAD")
set(PACKAGE_VERSION_MAJOR "0")
set(PACKAGE_VERSION_MINOR "15")
set(PACKAGE_VERSION_PATCH "4664")
set(PACKAGE_VERSION_MINOR "16")
set(PACKAGE_VERSION_PATCH "4665")
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
@@ -42,18 +42,25 @@ else(WIN32)
set(PLATFORM_MK mkdir -p)
endif(WIN32)
# ================================================================================
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Issues with boost::any on older versions with C++11 enabled.
set(BOOST_MIN_VERSION 1.55)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANGXX TRUE)
endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# make this an option because for older compilers C++11 doesn't work properly.
OPTION(BUILD_ENABLE_CXX11 "Enable C++11 support." ON)
if (BUILD_ENABLE_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(BUILD_ENABLE_CXX11)
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
include(cMake/ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-write-strings")
set(CMAKE_CXX_FLAGS "-Wall -Wno-deprecated -Wno-write-strings ${CMAKE_CXX_FLAGS}")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# get linker errors as soon as possible and not at runtime e.g. for modules
if(UNIX)
@@ -61,6 +68,15 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
endif(UNIX)
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
IF(CMAKE_COMPILER_IS_GNUCXX)
EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION )
IF(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSE(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
UNSET(BOOST_MIN_VERSION) # For Ubuntu 12.04
ENDIF(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
ENDIF()
# ================================================================================
# Output directories for install target
@@ -118,8 +134,9 @@ endif(MSVC)
OPTION(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON)
OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3rd party libs. On Windows the Installer is build." OFF)
OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF)
OPTION(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF)
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
if(APPLE)
@@ -127,15 +144,24 @@ if(APPLE)
if(FREECAD_CREATE_MAC_APP)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/src/MacAppBundle/FreeCAD.app
DESTINATION ${CMAKE_INSTALL_PREFIX}
DIRECTORY ${CMAKE_SOURCE_DIR}/src/MacAppBundle/FreeCAD.app/
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app
)
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/FreeCAD.app/Contents)
SET(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
# It should be safe to assume we've got sed on OSX...
install(CODE "
execute_process(COMMAND
sed -i \"\" -e s/VERSION_STRING_FROM_CMAKE/${PACKAGE_VERSION}/
-e s/NAME_STRING_FROM_CMAKE/${PACKAGE_NAME}/
${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app/Contents/Info.plist)
")
set(CMAKE_INSTALL_PREFIX
${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app/Contents)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
endif(FREECAD_CREATE_MAC_APP)
endif(APPLE)
OPTION(BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
OPTION(BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
OPTION(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
OPTION(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
@@ -155,6 +181,7 @@ OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
OPTION(BUILD_PART "Build the FreeCAD part module" ON)
OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
OPTION(BUILD_PATH "Build the FreeCAD path module" ON)
OPTION(BUILD_PLOT "Build the FreeCAD plot module" ON)
OPTION(BUILD_POINTS "Build the FreeCAD points module" ON)
OPTION(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
@@ -169,21 +196,26 @@ OPTION(BUILD_WEB "Build the FreeCAD web module" ON)
OPTION(BUILD_VR "Build the FreeCAD Oculus Rift support (need Oculus SDK 4.x or higher)" OFF)
if(MSVC)
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" OFF)
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
elseif(APPLE)
find_library(3DCONNEXIONCLIENT_FRAMEWORK 3DconnexionClient)
if(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
else(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." OFF)
endif(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
else(MSVC)
set(FREECAD_USE_3DCONNEXION OFF)
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." ON)
set(FREECAD_USE_3DCONNEXION OFF)
endif(MSVC)
if(NOT MSVC)
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
endif(NOT MSVC)
# if this is set override some options
if (FREECAD_BUILD_DEBIAN)
set(FREECAD_USE_EXTERNAL_ZIPIOS ON)
set(FREECAD_USE_EXTERNAL_PIVY ON)
# A Debian package for SMESH doesn't exist
#set(FREECAD_USE_EXTERNAL_SMESH ON)
endif (FREECAD_BUILD_DEBIAN)
@@ -257,12 +289,6 @@ if(BUILD_MESH_PART)
set(BUILD_SMESH ON)
endif(BUILD_MESH_PART)
#inferred from cmakelists.txt. build errors. obsolete?
if(BUILD_CAM)
set(BUILD_PART ON)
set(BUILD_MESH ON)
endif(BUILD_CAM)
#inferred from cmakelists.txt. appears to be working.
if(BUILD_RAYTRACING)
set(BUILD_PART ON)
@@ -271,6 +297,7 @@ endif(BUILD_RAYTRACING)
#inferred from cmakelists.txt. appears to be working.
if(BUILD_DRAWING)
set(BUILD_PART ON)
set(BUILD_SPREADSHEET ON)
endif(BUILD_DRAWING)
#inferred from cmakelists.txt. appears to be working.
@@ -278,6 +305,12 @@ if(BUILD_ROBOT)
set(BUILD_PART ON)
endif(BUILD_ROBOT)
#path module dependencies.
if(BUILD_PATH)
set(BUILD_PART ON)
#set(BUILD_ROBOT ON) reenable this when using KDL
endif(BUILD_PATH)
#inferred from cmakelists.txt. appears to be working.
if(BUILD_SKETCHER)
set(BUILD_PART ON)
@@ -310,13 +343,17 @@ if(BUILD_JTREADER)
set(BUILD_MESH ON)
endif(BUILD_JTREADER)
#a runtime dependency
if(BUILD_START)
set(BUILD_WEB ON)
endif(BUILD_START)
#leaving test module for someone else.
#image has none. as far as I can tell.
#mesh has none. as far as I can tell.
#part has none. as far as I can tell.
#material has none. as far as I can tell.
#web has none. as far as I can tell.
#start has none. as far as I can tell.
#assembly has none. as far as I can tell.
#plot has none. as far as I can tell.
#points has none. as far as I can tell
@@ -360,7 +397,6 @@ if(FREECAD_LIBPACK_USE)
set(FREECAD_LIBPACK_VERSION "9.x" CACHE STRING "Displays if the libpack has been found" FORCE)
include(cMake/UseLibPack9x.cmake)
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-2.0.11/swig.exe CACHE STRING "Swig" FORCE)
set(FREECAD_USE_EXTERNAL_PIVY ON CACHE BOOL "Switch off local pivy" FORCE)
set(FREECAD_LIBPACK_PYSIDEUIC_REL "${FREECAD_LIBPACK_DIR}/pyside-tools/Lib/site-packages")
file(GLOB FREECAD_LIBPACK_PIVY_COIN "${FREECAD_LIBPACK_DIR}/pivy/*.*")
file(GLOB FREECAD_LIBPACK_SHIBOKEN "${FREECAD_LIBPACK_DIR}/shiboken-1.2.1/lib/site-packages/*.pyd")
@@ -388,7 +424,9 @@ if(FREECAD_LIBPACK_USE)
find_package(SWIG)
IF(NOT SWIG_FOUND)
MESSAGE("SWIG was not found, build no SWIG binding for pivy")
MESSAGE("==================================================\n"
"SWIG not found, don't build SWIG binding for pivy.\n"
"==================================================\n")
ENDIF(NOT SWIG_FOUND)
# -------------------------------- Shiboken/PySide ------------------------
@@ -411,38 +449,172 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# -------------------------------- Python --------------------------------
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
# Acceptable versions of Python
set(Python_ADDITIONAL_VERSIONS "2.5" "2.6" "2.7" "2.8" "2.9")
# For building on OS X
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# If the user doesn't tell us which package manager they're using
if(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
# Try to find MacPorts path
find_program(MACPORTS_EXECUTABLE port)
if(EXISTS ${MACPORTS_EXECUTABLE})
string(REPLACE "/bin/port" ""
MACPORTS_PREFIX ${MACPORTS_EXECUTABLE})
message(STATUS "Detected MacPorts install at ${MACPORTS_PREFIX}")
endif(EXISTS ${MACPORTS_EXECUTABLE})
# Try to find Homebrew path
find_program(HOMEBREW_EXECUTABLE brew)
if(EXISTS ${HOMEBREW_EXECUTABLE})
string(REPLACE "/bin/brew" ""
HOMEBREW_PREFIX ${HOMEBREW_EXECUTABLE})
message(STATUS "Detected Homebrew install at ${HOMEBREW_PREFIX}")
endif()
endif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
# In case someone tries to shoot themselves in the foot
if(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
message(SEND_ERROR
"Multiple package management systems detected - ")
message(SEND_ERROR
"define either MACPORTS_PREFIX or HOMEBREW_PREFIX")
# No package manager
elseif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
message(SEND_ERROR
"No package manager detected - install MacPorts or Homebrew")
# The hopefully-normal case - one package manager identified
else(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
# Construct a list like python;python2.9;python2.8;...
set(Python_ADDITIONAL_VERSIONS_REV ${Python_ADDITIONAL_VERSIONS})
list(REVERSE Python_ADDITIONAL_VERSIONS_REV)
set(_PYTHON_NAMES "python")
foreach(_PYTHON_VERSION IN LISTS Python_ADDITIONAL_VERSIONS_REV)
list(APPEND _PYTHON_NAMES "python${_PYTHON_VERSION}")
endforeach(_PYTHON_VERSION)
# Find python in the package management systems, using names in that
# list in decreasing priority. Note that a manually specified
# PYTHON_EXECUTABLE still has prescedence over this.
find_program(PYTHON_EXECUTABLE
NAMES ${_PYTHON_NAMES}
PATHS ${MACPORTS_PREFIX} ${HOMEBREW_PREFIX}
PATH_SUFFIXES /bin
NO_DEFAULT_PATH)
endif(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
# Warn user if we still only have the system Python
string(FIND ${PYTHON_EXECUTABLE} "/usr/bin/python" _FIND_SYS_PYTHON)
if(_FIND_SYS_PYTHON EQUAL 0)
message(SEND_ERROR
"Only found the stock Python, that's probably bad.")
endif(_FIND_SYS_PYTHON EQUAL 0)
# Ask Python to tell us it's include directory, if nobody else has
if(NOT DEFINED PYTHON_INCLUDE_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"from distutils.sysconfig import get_python_inc;print get_python_inc()"
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT
ERROR_QUIET)
if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR")
endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
endif(NOT DEFINED PYTHON_INCLUDE_DIR)
# Similar for the Python library - there must be an easier way...
if(NOT DEFINED PYTHON_LIBRARY)
# Get the library path
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
"from distutils import sysconfig;print sysconfig.get_config_var('LIBDIR')"
OUTPUT_VARIABLE PYTHON_LIBRARY_DIR
RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT
ERROR_QUIET)
string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR)
if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
# Get library filename - might not be safe to assume .dylib extension?
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
"import sys;print 'libpython%d.%d.dylib'%sys.version_info[0:2]"
OUTPUT_VARIABLE PYTHON_LIBRARY_FILE
RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT
ERROR_QUIET)
string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE)
if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}")
else(NOT DEFINED PYTHON_LIBRARY)
# Used on MacPorts systems for finding Shiboken and PySide
# TODO: When we start requiring minimum CMake version above
# 2.8.11, change PATH below to DIRECTORY
get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARY} PATH)
endif(NOT DEFINED PYTHON_LIBRARY)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
set(Python_ADDITIONAL_VERSIONS "2.3" "2.4" "2.5" "2.6" "2.7" "2.8" "2.9")
find_package(PythonInterp REQUIRED)
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
IF (NOT DEFINED PYTHON_VERSION_STRING)
find_package(PythonLibs REQUIRED)
ELSE (NOT DEFINED PYTHON_VERSION_STRING)
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
ENDIF(NOT DEFINED PYTHON_VERSION_STRING)
IF(NOT PYTHONLIBS_FOUND)
MESSAGE("Python not found, install python!")
MESSAGE(FATAL_ERROR "=================================\n"
"Python not found, install Python!\n"
"=================================\n")
ENDIF(NOT PYTHONLIBS_FOUND)
# -------------------------------- pcl ----------------------------------
#PCL needs to be found before boost because the PCLConfig also calls find_package(Boost ...),
#but with different components
if(FREECAD_USE_PCL)
find_package(PCL REQUIRED COMPONENTS common kdtree features surface io)
find_package(PCL REQUIRED COMPONENTS common kdtree features surface io filters segmentation sample_consensus)
endif(FREECAD_USE_PCL)
# -------------------------------- Boost --------------------------------
SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.41.0" "1.39.0" "1.38.0" "1.37.0"
"1.36.1" "1.36.0" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34"
"1.33.1" "1.33.0" "1.33" )
SET(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})
find_package(Boost COMPONENTS filesystem program_options regex signals system thread REQUIRED)
find_package(Boost ${BOOST_MIN_VERSION}
COMPONENTS filesystem program_options regex signals system thread REQUIRED)
IF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "========================================\n"
"boost not found, install the components:\n"
" * filesystem\n"
" * program_options\n"
" * regex\n"
" * signals\n"
" * system\n"
" * thread\n"
"========================================\n")
ENDIF(NOT Boost_FOUND)
# -------------------------------- XercesC --------------------------------
find_package(XercesC REQUIRED)
IF(NOT XercesC_FOUND)
MESSAGE(FATAL_ERROR "==================\n"
"XercesC not found.\n"
"==================\n")
ENDIF(NOT XercesC_FOUND)
# -------------------------------- ZLIB --------------------------------
@@ -455,6 +627,11 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# -------------------------------- OpenCasCade --------------------------------
find_package(OpenCasCade)
IF(NOT OCC_FOUND)
MESSAGE(FATAL_ERROR "================================================================\n"
"Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
"================================================================\n")
ENDIF(NOT OCC_FOUND)
# -------------------------------- Salome SMESH --------------------------
@@ -465,7 +642,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
else()
find_package(SMESH)
if(NOT SMESH_FOUND)
message(ERROR "SMESH was not found.")
message(ERROR "================\n"
"SMESH not found.\n"
"================\n")
endif()
include_directories(${SMESH_INCLUDE_DIR})
endif()
@@ -488,16 +667,19 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
find_package(SWIG)
IF(NOT SWIG_FOUND)
MESSAGE("SWIG was not found, build no SWIG binding for pivy")
MESSAGE("==================================================\n"
"SWIG not found, don't build SWIG binding for pivy.\n"
"==================================================\n")
ENDIF(NOT SWIG_FOUND)
# -------------------------------- Eigen --------------------------------
find_package(Eigen3)
# -------------------------------- ODE ----------------------------------
# find_package(ODE)
IF(NOT EIGEN3_FOUND)
MESSAGE("=================\n"
"Eigen3 not found.\n"
"=================\n")
ENDIF(NOT EIGEN3_FOUND)
# -------------------------------- Qt --------------------------------
@@ -512,16 +694,21 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
set(QT_USE_QTUITOOLS TRUE)
set(QT_USE_QTWEBKIT TRUE)
endif(BUILD_GUI)
find_package(Qt4 REQUIRED)
find_package(Qt4)# REQUIRED
include(${QT_USE_FILE})
IF(NOT QT4_FOUND)
MESSAGE("Library qt-4.3 or above is not available, install QT or FreeCAD Gui version will not be built")
MESSAGE(FATAL_ERROR "=======================\n"
"Qt libraries not found.\n"
"=======================\n")
ENDIF(NOT QT4_FOUND)
IF(NOT QT_QTWEBKIT_FOUND)
MESSAGE("Qt Webkit not found, will not build browser integration!")
MESSAGE("=====================================================\n"
"Qt Webkit not found, don't build browser integration.\n"
"=====================================================\n")
ENDIF(NOT QT_QTWEBKIT_FOUND)
@@ -555,7 +742,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
if(FREECAD_USE_FREETYPE)
find_package(Freetype)
if(NOT FREETYPE_FOUND)
MESSAGE("FreeType2 library is not available. Part module will lack of makeWireString().")
MESSAGE("===============================================================\n"
"FreeType2 not found. Part module will lack of makeWireString().\n"
"===============================================================\n")
endif(NOT FREETYPE_FOUND)
endif(FREECAD_USE_FREETYPE)
@@ -565,18 +754,25 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# -------------------------------- OpenGL --------------------------------
find_package(OpenGL)
include(FindPackageMessage)
if(OPENGL_GLU_FOUND)
find_package_message(OPENGL_GLU
"Found OpenGLU: ${OPENGL_glu_LIBRARY}"
"[${OPENGL_glu_LIBRARY}][${OEPNGL_INCLUDE_DIR}]")
else(OPENGL_GLU_FOUND)
message(FATAL_ERROR "The GLU library is required. Make sure it is installed.")
endif(OPENGL_GLU_FOUND)
include(FindPackageMessage)
if(OPENGL_GLU_FOUND)
find_package_message(OPENGL_GLU
"Found OpenGLU: ${OPENGL_glu_LIBRARY}"
"[${OPENGL_glu_LIBRARY}][${OEPNGL_INCLUDE_DIR}]")
else(OPENGL_GLU_FOUND)
message(FATAL_ERROR "======================\n"
"GLU library not found.\n"
"======================\n")
endif(OPENGL_GLU_FOUND)
# -------------------------------- Coin3D --------------------------------
find_package(Coin3D REQUIRED)
if(NOT COIN3D_FOUND)
MESSAGE(FATAL_ERROR "=================\n"
"Coin3D not found.\n"
"=================\n")
endif(NOT COIN3D_FOUND)
# ------------------------------ Spaceball -------------------------------
@@ -591,9 +787,27 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
SET(PYTHON_SUFFIX -python2.7) # for shiboken
SET(PYTHON_BASENAME -python2.7) # for PySide
find_package(Shiboken REQUIRED)
find_package(PySide REQUIRED)
find_package(PySideTools REQUIRED) # Pyside utilities (pyside-uic & pyside-rcc)
if(DEFINED MACPORTS_PREFIX)
find_package(Shiboken REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
find_package(PySide REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
endif(DEFINED MACPORTS_PREFIX)
find_package(Shiboken)# REQUIRED
if(NOT SHIBOKEN_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "===================\n"
"shiboken not found.\n"
"===================\n")
endif(NOT SHIBOKEN_INCLUDE_DIR)
find_package(PySide)# REQUIRED
if(NOT PYSIDE_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "=================\n"
"PySide not found.\n"
"=================\n")
endif(NOT PYSIDE_INCLUDE_DIR)
find_package(PySideTools REQUIRED) # PySide utilities (pyside-uic & pyside-rcc)
# ------------------------------ Matplotlib ------------------------------
@@ -601,7 +815,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
IF(MATPLOTLIB_FOUND)
message(STATUS "-- matplotlib-${MATPLOTLIB_VERSION} has been found.")
ELSE(MATPLOTLIB_FOUND)
message("-- matplotlib not found, Plot module won't be available!")
message("=====================================================\n"
"matplotlib not found, Plot module won't be available.\n"
"=====================================================\n")
ENDIF(MATPLOTLIB_FOUND)
# ------------------------------------------------------------------------
@@ -626,6 +842,13 @@ endif(WIN32)
# version information of libraries
#
if(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx)
set(HAVE_OCC_VERSION 1)
endif(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx)
configure_file(LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersions.h)
# ================================================================================
# == Global Compiler and Linker Settings =========================================
@@ -653,7 +876,8 @@ IF(MSVC)
set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}")
# set linker flag /nodefaultlib
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB")
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
IF(FREECAD_RELEASE_PDB)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
@@ -684,10 +908,6 @@ IF(MINGW)
# SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
LINK_LIBRARIES(-lgdi32)
ENDIF(MINGW)
# 0000661: cmake build on Mac OS: dealing with dylib versus so
IF(APPLE)
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
ENDIF(APPLE)
# force build directory to be different to source directory
#if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
@@ -779,10 +999,6 @@ if(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
"tar.gz"
"~$"
)
#set(CPACK_SOURCE_IGNORE_FILES
# ${CPACK_SOURCE_IGNORE_FILES}
# "/Pivy-0.5/"
#)
set(CPACK_SOURCE_STRIP_FILES "")
include(CPack)
@@ -812,3 +1028,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# Print message to start build process
if (${CMAKE_BUILD_TOOL} MATCHES "make")
MESSAGE("=======================================\n"
"Now run 'make' to build ${PACKAGE_NAME}\n"
"=======================================\n")
endif()
+13
View File
@@ -0,0 +1,13 @@
#ifndef LIBRARY_VERSIONS_H
#define LIBRARY_VERSIONS_H
/* LibraryVersions.h. Generated from LibraryVersions.h.cmake by cmake. */
#cmakedefine HAVE_OCC_VERSION
#if defined(HAVE_OCC_VERSION)
# include <${OCC_INCLUDE_DIR}/Standard_Version.hxx>
#endif
#endif // LIBRARY_VERSIONS_H
-93
View File
@@ -1,93 +0,0 @@
How to build and run FreeCAD under Cygwin
=========================================
Prerequisites
-------------
To compile FreeCAD, you will need, besides functioning Cygwin environment
and programming tools (like compiler), the following libraries:
o Python (http://www.python.org), >= 2.5.x
o Qt (http://www.trolltech.no), >= 4.1.x
o Coin3D (http://www.coin3d.org), >= 2.4.x
o SoQt (http://www.coin3d.org), >= 1.2.x
o Xerces-c (http://xml.apache.org/dist/xerces-c/)
o zlib (http://www.zlib.net/)
As far as I know, except of Coin3D and SoQt all libraries are available as prebuilt
binary packages from one of the Cygwin mirrors. To install them, first download the
latest version of setup.exe from www.cygwin.com and run it with administrator rights.
Then follow the instructions of the wizard until the list of all available packages
appears. Select the devel files of all the required libraries and install them.
Then download the source tarballs of Coin3D and SoQt and unpack them into a directory
of your choice.
The Coin library can be built with ./configure --disable-msvc;make; make install.
Building SoQt is a bit tricky and I haven't managed yet to build it in a proper way.
There are various problems with X11 functions and Windows API functions which I
don't know how to solve.
And for the Mesh module of FreeCAD the additional libraries
o GTS Library (http://gts.sourceforge.net)
o Wild Magic (http://www.geometrictools.com)
o OpenCASCADE (http://www.opencascade.org), you need >=5.2 here
are required. OpenCASCADE is also needed by the Part and Raytracing modules.
Note: As OpenCASCADE that is also required by the Mesh, Part and Raytracing
modules is not available for Cygwin it is not possible to build them
for this platform. It is planned for the future to move all OpenCASCADE
dependencies of the Mesh module into a separate module so that at least
this module can be built under Cygwin.
Note: All libraries listed above must be built as shared library. Refer to their
documentation to see how to do.
Note: If possible you should enable thread support for the libraries. At least for
Qt thread support is strongly recommended, otherwise you will run into linker
errors at build time of FreeCAD.
Note: zlib might be already on your system, as this is a library that is used
from a lot of other libraries.
Note: There seems to be various problems with Qt's uic tool of the Cygwin port.
Due to these problems it is not possible to run the GUI under Cygwin at the
moment. It is only possible to run the commandline version.
Configuration
-------------
For the build process of FreeCAD we make use of configure scripts.
To have an overview of all options type in ./configure --help, first.
If you have installed all libraries above into standard paths you need not any of the
'--with' options at all. Unless you have installed any library into a non-standard path,
then make use of the --with-XXX-includes or --with-XXX-libs options.
(XXX represents the corresponding library.)
Note: Due to some limitations of the Windows platform it is not possible to build
libraries with unresolved symbols at link time. Thus it is strongly recommended to run
./configure with the option LDFLAGS=-no-undefined, otherwise the creation of shared
libraries fails. For more details see section 11.2.1 Creating Libtool Libraries with
Automake of the libtool documentation.
Note: To specify FreeCAD's root directory it is recommended to use only the '--prefix'
option from the configure script but not the --bindir, --libdir, ... options, because
at startup FreeCAD makes assumptions where its lib-, doc-, .. directories reside.
The default root directory is located in ~/FreeCAD.
If you know how to work with GNU autoconf, feel free to contribute improvements
to our configuration scripts --- that would be great.
Installation
------------
Once you have built the sources successfully using 'make' with 'make install' you can
install FreeCAD onto your machine whereever you want. Go to the directory FreeCAD/bin
and just type in ./FreeCADCmd.
FreeCAD's default root directory resides under ~/FreeCAD, so you don't need root privileges
therefore.
-99
View File
@@ -1,99 +0,0 @@
How to build and run FreeCAD under Linux
========================================
Prerequisites
-------------
To compile FreeCAD you will need, besides functioning Linux
and programming tools (like compiler), the following libraries:
o Python (http://www.python.org), >= 2.5.x
o boost (http://www.boost.org), >= 1.33.1
o Qt (http://qt-project.org/), >= 4.1.x
o PySide (http://qt-project.org/wiki/category:LanguageBindings::PySide::Downloads)
o Coin3D (http://www.coin3d.org), >= 2.4.x
o SoQt (http://www.coin3d.org), >= 1.2.x
o Xerces-C++ (http://xml.apache.org/dist/xerces-c/), >= 2.6
o zlib (http://www.zlib.net/)
And for the some FreeCAD modules the additional libraries
o OpenCascade (http://www.opencascade.org), >= 5.2
o Eigen3 (http://eigen.tuxfamily.org/index.php?title=Main_Page), >= 3.0.1
o FreeType
are required.
Note: zlib might be already on your system, as this is a library that is used
by a lot of libraries, too.
Note: All libraries listed above must be built as shared library. Refer to their
documentation to see how to do.
Note: If possible you should enable thread support for the libraries. At least for
Qt thread support is strongly recommended, otherwise you will run into linker
errors at build time of FreeCAD.
Note: The package for SoQt for Debian based systems may lack of the soqt.m4 macro file.
You should download the file from www.coin3d.org and copy it to /usr/share/aclocal.
Note: The package for SoQt (at least for older Debian based systems) is usually built to link
against Qt3. This, however, causes a segmentation fault when using with FreeCAD because
it links against Qt4 and you get a mixup of Qt3 and Qt4 libraries.
To fix this problem you must download the sources from www.coin3d.org and run
configure with the 'with-qt=DIR' switch specifying the location of Qt4.
Probably, it's best to 'make install' the newly built SoQt into a different directory
than the installed SoQt to avoid to corrupt your package database and/or to keep other
applications working. When configuring FreeCAD you have to use the '--with-soqt=DIR'
switch specifying the path of the newly installed SoQt.
For newer Debian releases this already solved by a new package that links against Qt4.
During the compilation some Python scripts get executed. So the Python interpreter has
to work properly.
Optionally, you can build the Qt plugin that provides all custom widgets of FreeCAD
we need for the Qt Designer. The sources are located under Tools/plugins/widget.
So far, we don't provide a makefile but calling 'qmake plugin.pro' creates it and
calling 'make' will create the library libFreeCAD_widgets.so. To make known this library
to your Qt Designer you have to copy the file to $QTDIR/plugin/designer.
On our Wiki you'll find more information to build with different Linux distributions at
http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=CompileOnUnix
Configuration
-------------
For the build process of FreeCAD we make use of configure scripts.
To have an overview of all switches type in ./configure --help, first.
You don't need any of these switches unless you have installed a library into a non-standard
path. In this case make use of the appropriate --with-XXX-include or --with-XXX-lib switches,
please. (XXX stands for the corresponding library.)
Of course, for above mentioned problem with SoQt you should use the '--with-soqt=DIR' switch.
Note: To specify FreeCAD's root directory it is recommended to use only the '--prefix'
switch from the configure script but not the --bindir, --libdir, ... switches, because at startup
FreeCAD makes assumptions about where its module directories are installed.
Installation & Running FreeCAD
------------------------------
Once you have built the sources successfully using 'make', with 'make install' you can
install FreeCAD onto your machine whereever you want. FreeCAD's default root directory
is $HOME/FreeCAD, so you don't need root privileges therefore. To run FreeCAD go to
$PREFIX/FreeCAD/bin and type in ./FreeCAD.
Note: In the past there were a lot of problems that the Part workbench couldn't be loaded.
The problem is that the system wasn't able to find the OpenCascade library files.
To fix this problem you are strongly recommended to add the path of these libraries
to LD_LIBRARY_PATH or even to add it to ld.so.conf and run ldconfig.
So, just have fun!
Werner Mayer <wmayer@users.sourceforge.net>
June 2014
-324
View File
@@ -1,324 +0,0 @@
How to build and run FreeCAD under MSYS/MinGW
=============================================
Prerequisites
-------------
Here comes a short introduction how to setup a MSYS/MinGW environment
on a Windows system, to build all needed libraries and finally to build
the FreeCAD sources.
o MSYS/MinGW
If not already installed get a MinGW installer from the Sourceforge page at
http://sourceforge.net/projects/mingw. When writing this tutorial the latest
version was mingw-get-inst-20100831.exe. Download and just double-click the
excutable. This installs the compiler and a minimal Windows developer environment.
Make sure to also install the Fortran compiler because there is a single Fortran
file in the 3rd party folder of the FreeCAD sources.
Then as second step MSYS needs to be installed to have an environment to run
./configure scripts which we make heavy use of in order to build all needed
libraries. From the Soureforge page the file MSYS-1.0.11.exe was taken.
A virginal MSYS/MinGW installation lacks of a few modules we later need.
First, we need the utility pexport which can be found in the file
pexports-0.44-1-mingw32-bin.tar.lzma. I don't know where to put this file
and how to make MSYS to install the stuff inside. But the file can be opened
with a ZIP program and the content can be copied to their destination manually.
Here, the pexports utility can go to the bin directory of your MinGW installation.
Then, we also need the development files for the pthreads module which is part
of the file pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma. Just download and copy
the files inside to your MinGW installation.
o CMake
Download the CMake utility from http://www.cmake.org/cmake/resources/software.html.
Get the archive with the binaries for the Windows platform and unpack whereever you
want. There is nothing further to do for this.
o SWIG
Download the SWIG utility from www.swig.org and extract it somewhere on your harddisk.
Third party libraries
---------------------
Here is a description which libraries we need for FreeCAD and how to build them from
the sources. In order not to pollute our MinGW installation with too many files from
the 3rd party libraries we have to build you can e.g. create a sub-directory "local"
in your MSYS installation. If you have installed MSYS under C:\MSYS then simply create
the directory C:\MSYS\1.0\local.
o zlib
For zlib there is already a ready package for MinGW. So, therefore simply download
the file libz-1.2.3-1-mingw32-dev.tar.gz from the Sourceforge site and extract the
two directories lib and include to C:\MSYS\1.0\local.
o Python
It seems to be nearly impossible to build the Python sources directly with the MinGW
compiler. This is because some Python modules require some features which are not
implemented on the MinGW platform. Fortunately, the Python sources are plain C code
and instead of trying to build it with MinGW you can get a ready binary package built
with the MSVC compiler. You can install the Python stuff whereever you want. Afterwards
copy the include folder to C:\MSYS\1.0\local, the DLL can go to C:\MSYS\1.0\local\bin.
Now we also need the so called import library. There we cannot use the .lib file which
comes together with the installer. But it's easy to create one with the pexports/dlltool
utilities. Assuming the Python version is 2.6 do these two steps:
pexports python26.dll > python26.def
dlltool -D python26.dll -d python26.def -l libpython26.dll.a
The file libpython26.dll.a can now be moved to C:\MSYS\1.0\local\lib.
o f2c
For this library we don't need any header files but only the import library to build the
Salome SMESH sources. The easiest way to build this file is:
pexports libgfortran-3.dll > f2c.def
dlltool -D libgfortran-3.dll -d f2c.def -l libf2c.dll.a
The file libf2c.dll.a can now be moved to C:\MSYS\1.0\local\lib.
o xerces-c
Download a source archive from http://xml.apache.org/dist/xerces-c/ and extract it.
Open a MSYS command line window and change to the xerces-c sources. From there run
./configure LDFLAGS=-no-undefined
Once ./configure has finished it's best to move to the source directory because we
don't need to build the dozens of test applications and other stuff. So, do this:
cd src
make
make install
This takes a few minutes to be done.
o boost
For boost there exists a testing package with cmake support. This, however, seems to be
stable enough to build with the MinGW compiler. So, get the file boost-1.41.0.cmake0.zip
from http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/ and unpack it.
Now, start the cmake-gui.exe from within the MSYS command line. This is necessary for cmake
in order to find the compiler and other stuff. Select the folder of the boost sources with
the CMakeLists.txt file, select a build directory and start Configure. You'll be asked for
which system you want to generate the Makefiles. Select MSYS/Makefiles, not MinGW/Makefiles.
When the configuration step has finished go to the options and search for WINMANGLE_LIBNAMES.
Switch this off because otherwise the boost library names contain the compiler name. This
causes the boost cmake check to fail later when we try to build the FreeCAD sources. And for
the installtion folder choose the directory C:\MSYS\1.0\local.
So, reconfigure boost and press on Generate once it has finished. Close the CMake GUI window
and enter
make
make install
into the command line. This will take a couple of minutes.
o eigen2
Download eigen-2.0.15.tar.gz or any later version from http://eigen.tuxfamily.org/index.php?title=Main_Page.
Unpack the files and start again cmake-gui. Set the installation directory to C:\MSYS\1.0\local
and press on Configure and Generate. Close the window and start the installation with
make
make install
o Qt4
From the Qt website at ftp://ftp.trollech.com you can download already prebuilt packages for the
MinGW platform. But depending on the version you have installed it can happen that they don't fit
together. In this case the source tarball must be downloaded. Use version 4.5.3 or higher. Unpack
the sources and start the configure.exe you'll find inside the sources.
./configure
By default the build the debug and release version. If you only want the release version use the
option "-release".
Configure will ask you some questions under which license you want to use Qt. Choose LGPL here.
Now run the build with
make
This can take quite some time because Qt has become a really huge library over the years. Once the
build has finished run a
make install
to copy the header files to their right place. All the binaries and header files are still inside
the source folder. If you like you can copy all the .dll, .a, and the direcories under "include" to
the subdirectories of C:\MSYS\1.0\local.
o Coin
Get a source archive from www.coin3d.org. Unpack the sources and run
./confiure
make
make install
It may happen that a message dialog pops up due to a missing cygwin1.dll. You simply ignore this.
o SoQt
Get a source archive from www.coin3d.org. Unpack the sources and run
./configure CXXFLAGS="-DCOIN_DLL" --with-qt=/usr/local
make
make install
In case your Qt development files are not under /usr/local choose the correct directory there.
Again a message dialog may pop up due to the missing cygwin1.dll.
o PyQt/sip
Warning: the following is obsoleted from version 0.14, since FreeCAD is now using
pySide instead of PyQt. At the moment, PySide suport for MingW seems still not complete:
https://bugreports.qt-project.org/browse/PYSIDE-113?page=com.atlassian.jira.plugin.system.issuetabpanels%3aall-tabpanel
Download the sources archives for sip and PyQt4 from www.riverbankcomputing.co.uk.
In order to build sip extract the archive and open a MSYS command line. From within
its source archive call
python configure.py --platform win32-g++ --destdir=/usr/local
make
It may happen that this step aborts because the Python include headers cannot be found.
In this case edit the Makefile and add the include path for the ython headers and also
the path and filename of the Python library.
Unfortunately, the 'make install' command doesn't work because the Makefile was generated
to use Windows batch commands instead of bash commands. Thus, copy the following files to
a path where Python can find it, e.g. /usr/local/bin.
sipconfig.py
sipdistutils.py
siputils.py
sip.pyd
sip.exe
In order to build PyQt4 extract the source archive and open a MSYS command line. Go to the
directory and start
export PATH=/usr/local/lib/:$PATH
python configure.py --destdir=/usr/local/lib/site-packages
make
Since the Makefile doesn't find the Python header files copy them all and also the file sip.h
to a directory where they can be found. A good place seems to be the directory of the Qt sources.
There copy the files to $QTDIR/include. The Python library file python26.dll.a can go $QTDIR/lib.
After the build has finished you have to copy all files that end with .pyd to their destination,
e.g. /usr/local/lib/site-packages/PyQt4. Lateron when you have built the FreeCAD sources you have
to copy the PyQt4 directory and sip.pyd to the FreeCAD bin directory or set a symlink.
o ODE
TODO: Still not clear if this will be used. (http://www.ode.org), >= 0.10.x
o OpenCASCADE
For the build of the OpenCASCADE libraries get the sources from www.opencascade.org or alternatively
it is also possible to download a stripped source tarball from the Debian mirrors which don't include
any fonts and other resource files.
Unpack the sources and download a CMake script from http://opencascade-cmake.googlecode.com/svn/trunk/
and the file occ_config.h.cmake. Copy both files into the 'ros' directory, start cmake-gui from
within a MSYS command line and select MSYS Makefiles. In the options the following switches can be
disabled:
OPENCASCADE_WRAPPERS
OPENCASCADE_VISUALISATION
OPENCASCADE_OCAF
OPENCASCADE_DRAW
Then specify for OPENCASCADE_INSTALL_PREFIX C:/MSYS/1.0/local as destination directory-
Now click the Configure button which takes a while and afterwards the Generate button.
Note: The original sources don't completely compile with MinGW. Therefore you have to apply the patch
OpenCASCADE6.3.0-MinGW.patch from http://code.google.com/p/opencascade-cmake/source/browse/trunk
Note: The original sources includes also a configure script and the Makefile.am files.
But it appeared to be very hard to build the libraries this way. Thus, it highly
recommended to do it the CMake way.
Note: For a couple of libraries the arguments passed to the linker exceeds the number of
allowed characters and thus the linker stops with an error: "Bad file number".
To solve this issue you can open the file build.make of the according library and
split the block (e.g. TKGeomAlgo_OBJECTS) into several smaller ones and modify the
build rule this way that you create first a static library, add the other object
files to the group and then unpack the static archive into one directory. This
trick solves the problem to reduce the whole number of characters.
Afterwards the shared library can be built out of these object files.
Example:
If the build.make file has a line of the form
g++ <options> -shared -o libTKGeomAlgo.dll $(TKGeomAlgo_OBJECTS) <libs>
then change it into
ar rcs win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS1)
ar q win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS2)
...
ar x win32/libTKGeomAlgo.a
g++ <options> -shared -o libTKGeomAlgo.dll *.obj <libs>
rm -f *.obj
o Netgen
Modify the following files:
* libsrc/meshing/improve2.hpp
Add DLL_HEADER to class MeshOptimize2d
* libsrc/meshing/meshclass.hpp
Add DLL_HEADER to CalcSurfacesOfNode
* libsrc/meshing/meshtype.hpp
Add DLL_HEADER to classes SurfaceElementIndex, MeshPoint, Element2d (int anp),
* libsrc/occ/occgeom.hpp
Add DLL_HEADER to classes Line, OCCGeometry, OCCParameters, OCCGenerateMesh
* libsrc/occ/occmeshsurf.hpp
Add DLL_HEADER to classes OCCSurface, Meshing2OCCSurfaces, MeshOptimize2dOCCSurfaces, OCCRefinementSurfaces
Run the configure script with these arguments
./configure --prefix=/usr/local --enable-shared --enable-occ --with-occ=/usr/local --with-tcl=/usr/local/lib --enable-nglib CXXFLAGS="-DNGLIB_EXPORTS -DWNT"
make && make install
Building the FreeCAD sources
----------------------------
In order build the FreeCAD sources either get the developer sources from the SVN repository
or get one of the .tar.gz tarballs and extract it.
Now start cmake-gui.exe from within a MSYS command line window and browse to the FreeCAD
sources and also define the build directory. Now run Configure. It may happen that cmake
complains about some not found libraries. In this case go through the listed libraries and
choose the include directory and/or the path to the library where needed. Once Confgiure
accepts all your input create the Makefiles by clicking on Generate. Now close the window
and enter
make
make install
This will take a couple of minutes. From the command line window change to the FreeCAD bin
folder and start the application with ./FreeCAD. In case it complains about some DLLs it cannot
find you have to extend your PATH environment variable with
export PATH=$PATH:/usr/local/bin:/usr/local/lib
If no grave problems remains repeating ./FreeCAD should start the application now.
Note: In order to let CMake detect the boost libraries you must make sure that the
DLLs are in the system path because the check builds some test applications
and tries to start them. If the DLLs are not in path CMake says that it cannot
find boost. In this case do a export PATH=/usr/local/lib:$PATH
Have fun!
-82
View File
@@ -1,82 +0,0 @@
How to build and run FreeCAD under Windows
==========================================
Prerequisites
-------------
On Windows we use the IDE MS VisualStudio 9 with the highest service pack.
In case you don't want to use MS products you can also use the MinGW compiler,
alternatively. In this case continue on reading the manual README.MinGW.
You need cMake 2.6 or higher to generate the project files for VisualStudio.
Also you need all the 3rd party libraries to succsefully compile FreeCAD.
Using LibPack
-------------
To make it easier to get FreeCAD compiled, we provide a collection of all
needed libraries. It's called the LibPack. You can find it on the download
page on sourceforge.
Python needed
-------------
During the compilation some Python scripts get executed. So the Python interpreter
has to function on the OS. Use a command box to check it. If the Python library is
not properly installed you will get an error message like Cannot find python.exe.
If you use the LibPack you can also use the python.exe in the bin directory.
Compile
-------
In order to build the FreeCAD sources start the GUI frontend of cmake. If
doesn't already find the header files and libraries of the LibPack you have to
define the path where you have unpacked it.
After you conform to all prerequisites the compilation is - hopefully - only
a mouse click in VC ;-)
After Compiling
---------------
To get FreeCAD up and running from the compiler environment you need to move a
few files from the LibPack to the "bin" folder where FreeCAD.exe is installed
after a successfull build:
* python.exe and python_d.exe from LIBPACK/bin
* python26.dll and python26_d.dll from LIBPACK/bin
* python26.zip from LIBPACK/bin
* make a copy of python26.zip and rename it to python26_d.zip
Additional stuff
----------------
If you want to build the source code documentation you need DoxyGen.
To create an intstaller package you need WIX.
Additional information on building special 3rd party libraries
--------------------------------------------------------------
* Mefisto2F
The Salome SMESH library needs the Mefisto2F library which contains some Fortran code.
The easiest way is to convert the Fortran code into C code and use the f2c library to
build a static library.
1. Get the f2c utility from http://netlib.sandia.gov/f2c/mswin/index.html
2. Convert the Fortran file trte.f into a C file trte.c using the f2c utility
>>> f2c trte.f
3. Get the sources for the lib f2c from http://netlib.sandia.gov/f2c/libf2c.zip and
unpack them.
4. Apply the patch 'mefisto2f.patch'
5. Run nmake -f makefile.vc
Alternatively, you can use the Watcom Fortran compiler. The needed project file can be get from
here: http://sourceforge.net/p/salomesmesh/code/HEAD/tree/trunk/adm/win32-watcom/
However, this doesn't work for x64 targets at the moment.
* FreeType
http://stackoverflow.com/questions/6207176/compiling-freetype-to-dll-as-opposed-to-static-library
+44 -29
View File
@@ -1,5 +1,7 @@
FreeCAD
=======
-------
![screenshot](http://www.freecadweb.org/wiki/images/thumb/7/72/Freecad016_screenshot1.jpg/800px-Freecad016_screenshot1.jpg)
FreeCAD is a general purpose feature-based, parametric 3D modeler for
CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering
@@ -15,25 +17,45 @@ FreeCAD runs exactly the same way on Windows, Mac OSX, BSD and Linux
platforms.
Home page: http://www.freecadweb.org
Documentation wiki: http://www.freecadweb.org/wiki/
Forum: http://forum.freecadweb.org/
Bug tracker: http://www.freecadweb.org/tracker/
Git repository: http://sourceforge.net/p/free-cad/code/ci/master/tree/
Git repository: https://github.com/FreeCAD/FreeCAD
Installing
==========
----------
Precompiled (installable) packages are usually available to you from
several sources and are described on the FreeCAD download page:
http://www.freecadweb.org/wiki/index.php?title=Download
Precompiled (installable) packages are available for Windows and Mac on the
releases page at https://github.com/FreeCAD/FreeCAD/releases
On most Linux distributions, FreeCAD is directly installable from the
software center application.
Other options are described at http://www.freecadweb.org/wiki/index.php?title=Download
Build Status <img src="https://cdn.travis-ci.org/images/travis-mascot-150-3791701416eeee8479e23fe4bb7edf4f.png" height="30"/>
------------
| Master | 0.16 |
|:------:|:----:|
|[![Master][freecad-master-status]][travis-branches]|[![0.16][freecad-0.16-status]][travis-branches]|
[freecad-0.16-status]: https://travis-ci-org/FreeCAD/FreeCAD.svg?branch=0.16
[freecad-master-status]: https://travis-ci.org/FreeCAD/FreeCAD.svg?branch=master
[travis-branches]: https://travis-ci.org/FreeCAD/FreeCAD/branches
[travis-builds]: https://travis-ci.org/FreeCAD/FreeCAD/builds
Compiling
=========
---------
Compiling FreeCAD requires to install several libraries and their
Compiling FreeCAD requires installation of several libraries and their
development files such as OpenCasCADe, Coin and Qt, listed in the
pages below. Once this is done, FreeCAD can be simply compiled with
cMake. On windows, these libraries are bundled and offered by the
cMake. On Windows, these libraries are bundled and offered by the
FreeCAD team in a convenience package, on Linux they are usually found
in your distribution's repositories and on Mac OSX and other platforms
you will usually need to compile them yourself.
@@ -41,41 +63,34 @@ you will usually need to compile them yourself.
The pages below contain up-to-date build instructions:
For Linux: http://www.freecadweb.org/wiki/?title=CompileOnUnix
For Windows: http://www.freecadweb.org/wiki/?title=CompileOnWindows
For Mac OSX: http://www.freecadweb.org/wiki/?title=CompileOnMac
For Cygwin: http://www.freecadweb.org/wiki/?title=CompileOnCygwin
For MinGW: http://www.freecadweb.org/wiki/?title=CompileOnMinGW
Usage & Getting help
====================
--------------------
The FreeCAD documentation wiki contains a lot of documentation on
general FreeCAD usage, python scripting, and development. The following
pages might help you to get started:
pages might help you get started:
Getting started: http://www.freecadweb.org/wiki/?title=Getting_started
Features list: http://www.freecadweb.org/wiki/?title=Features_list
Features list: http://www.freecadweb.org/wiki/?title=Feature_list
Frequent questions: http://www.freecadweb.org/wiki/?title=FAQ
Workbenches: http://www.freecadweb.org/wiki/?title=Workbench_Concept
Scripting: http://www.freecadweb.org/wiki/?title=Power_users_hub
Development: http://www.freecadweb.org/wiki/?title=Developer_hub
The FreeCAD forum at http://forum.freecadweb.org is also a great place
to find help and solve specific problems that you might encounter when
to find help and solve specific problems you might encounter when
learning to use FreeCAD.
+37 -31
View File
@@ -2,28 +2,29 @@
# Once done this will define
#
# COIN3D_FOUND - system has Coin3D - Open Inventor
# COIN3D_INCLUDE_DIR - where the Inventor include directory can be found
# COIN3D_LIBRARY - Link this to use Coin3D
# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
# COIN3D_LIBRARIES - Link this to use Coin3D
#
SET( COIN3D_FOUND "NO" )
IF (WIN32)
IF (CYGWIN)
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
/usr/include
/usr/local/include
/usr/include/coin
)
FIND_LIBRARY(COIN3D_LIBRARY Coin
FIND_LIBRARY(COIN3D_LIBRARIES Coin
/usr/lib
/usr/local/lib
)
ELSE (CYGWIN)
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
)
@@ -36,58 +37,63 @@ IF (WIN32)
)
IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
SET(COIN3D_LIBRARY optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
IF (COIN3D_LIBRARY_DEBUG)
SET (COIN3D_LIBRARY ${COIN3D_LIBRARY_DEBUG})
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
ENDIF (COIN3D_LIBRARY_DEBUG)
IF (COIN3D_LIBRARY_RELEASE)
SET (COIN3D_LIBRARY ${COIN3D_LIBRARY_RELEASE})
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
ENDIF (COIN3D_LIBRARY_RELEASE)
ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
IF (COIN3D_LIBRARY)
IF (COIN3D_LIBRARIES)
# ADD_DEFINITIONS ( -DCOIN_NOT_DLL )
#ELSE (COIN3D_LIBRARY)
# SET (COIN3D_LIBRARY coin2d CACHE STRING "Coin3D Library (Debug) - Open Inventor API")
ENDIF (COIN3D_LIBRARY)
#ELSE (COIN3D_LIBRARIES)
# SET (COIN3D_LIBRARIES coin2d CACHE STRING "Coin3D Library (Debug) - Open Inventor API")
ENDIF (COIN3D_LIBRARIES)
ENDIF (CYGWIN)
ELSE (WIN32)
IF(APPLE)
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
/Library/Frameworks/Inventor.framework/Headers
/usr/local/include
/usr/include
)
FIND_LIBRARY(COIN3D_LIBRARY Coin
FIND_LIBRARY(COIN3D_LIBRARIES Coin
/Library/Frameworks/Inventor.framework/Libraries
/usr/lib
/usr/local/lib
)
SET(COIN3D_LIBRARY "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
ELSE(APPLE)
SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
ELSE(APPLE)
# Try to use pkg-config first...
find_package(PkgConfig)
pkg_check_modules(COIN3D Coin)
# ... then fall back to manual lookup
IF(NOT COIN3D_FOUND)
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
/usr/include/Coin3
/usr/include
/usr/include/coin
/usr/local/include
)
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
/usr/include/Coin3
/usr/include
/usr/local/include
)
FIND_LIBRARY(COIN3D_LIBRARY Coin
/usr/lib
/usr/local/lib
PATH_SUFFIXES Coin2 Coin3
)
FIND_LIBRARY(COIN3D_LIBRARIES Coin
/usr/lib
/usr/local/lib
PATH_SUFFIXES Coin2 Coin3
)
ENDIF(NOT COIN3D_FOUND)
ENDIF(APPLE)
ENDIF (WIN32)
SET( COIN3D_FOUND "NO" )
IF(COIN3D_LIBRARY)
IF(COIN3D_LIBRARIES)
SET( COIN3D_FOUND "YES" )
ENDIF(COIN3D_LIBRARY)
ENDIF(COIN3D_LIBRARIES)
-39
View File
@@ -1,39 +0,0 @@
# This module finds the f2c library.
#
# This module sets the following variables:
# F2C_FOUND - set to true if library is found
# F2C_DEFINITIONS - compilation options to use f2c
# F2C_LIBRARIES - f2c library name (using full path name)
if (F2C_LIBRARIES)
set(F2C_FOUND TRUE)
else(F2C_LIBRARIES)
set(F2C_DEFINITIONS)
find_library(F2C_LIBRARIES f2c
/usr/lib
/usr/local/lib
)
if(F2C_LIBRARIES)
set(F2C_FOUND TRUE)
else()
set(F2C_FOUND FALSE)
endif()
if(NOT F2C_FIND_QUIETLY)
if(F2C_FOUND)
message(STATUS "f2c library found.")
else(F2C_FOUND)
if(F2C_FIND_REQUIRED)
message(FATAL_ERROR "f2c library not found. Please specify library location.")
else()
message(STATUS "f2c library not found. Please specify library location.")
endif()
endif(F2C_FOUND)
endif(NOT F2C_FIND_QUIETLY)
endif(F2C_LIBRARIES)
+42 -17
View File
@@ -1,23 +1,52 @@
# Try to find nglib/netgen
#
# Optional input NETGENDATA is path to the netgen libsrc source tree - this is
# required due to some headers not being installed by netgen.
#
# Once done this will define
#
# NGLIB_INCLUDE_DIR - where the nglib include directory can be found
# NGLIB_LIBRARIES - Link this to use nglib
# NETGEN_INCLUDE_DIRS - where the netgen include directories can be found
# NETGEN_DEFINITIONS - C++ compiler defines required to use netgen/nglib
#
# See also: http://git.salome-platform.org/gitweb/?p=NETGENPLUGIN_SRC.git;a=summary
# nglib
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h /usr/include)
FIND_LIBRARY(NGLIB_LIBRARIES nglib /usr/lib /usr/local/lib)
SET(NETGEN_DEFINITIONS -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
# netgen headers
SET(NETGEN_INCLUDE_DIRS)
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
IF(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
# We haven't supported Netgen prior to 5.3.1 on MacOS, and the current
# plan is for the next Netgen version to be 6.1 (currently unreleased).
LIST( APPEND NETGEN_DEFINITIONS -DNETGEN_V5 )
if(NOT NETGENDATA)
SET(NETGENDATA /usr/share/netgen/libsrc)
endif()
IF(DEFINED HOMEBREW_PREFIX)
EXEC_PROGRAM(brew ARGS --prefix nglib OUTPUT_VARIABLE NGLIB_PREFIX)
ELSE(DEFINED HOMEBREW_PREFIX)
SET(NGLIB_PREFIX ${MACPORTS_PREFIX})
ENDIF(DEFINED HOMEBREW_PREFIX)
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h ${NGLIB_PREFIX}/include)
FIND_LIBRARY(NGLIB_LIBNGLIB nglib ${NGLIB_PREFIX}/lib)
FIND_LIBRARY(NGLIB_LIBMESH mesh ${NGLIB_PREFIX}/lib)
FIND_LIBRARY(NGLIB_LIBOCC occ ${NGLIB_PREFIX}/lib)
FIND_LIBRARY(NGLIB_LIBINTERFACE interface ${NGLIB_PREFIX}/lib)
SET(NGLIB_LIBRARIES ${NGLIB_LIBNGLIB} ${NGLIB_LIBMESH}
${NGLIB_LIBOCC} ${NGLIB_LIBINTERFACE})
IF(NOT NETGENDATA)
SET(NETGENDATA ${NGLIB_PREFIX}/include/netgen)
ENDIF(NOT NETGENDATA)
ELSE(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h /usr/include)
FIND_LIBRARY(NGLIB_LIBRARIES nglib /usr/lib /usr/local/lib)
IF(NOT NETGENDATA)
SET(NETGENDATA /usr/share/netgen/libsrc)
ENDIF(NOT NETGENDATA)
ENDIF(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
FIND_PATH(NETGEN_DIR_csg csg.hpp PATHS ${NETGENDATA}/csg)
FIND_PATH(NETGEN_DIR_gen array.hpp PATHS ${NETGENDATA}/general)
@@ -28,12 +57,8 @@ FIND_PATH(NETGEN_DIR_mesh meshing.hpp PATHS ${NETGENDATA}/meshing)
FIND_PATH(NETGEN_DIR_occ occgeom.hpp PATHS ${NETGENDATA}/occ)
FIND_PATH(NETGEN_DIR_stlgeom stlgeom.hpp PATHS ${NETGENDATA}/stlgeom)
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_csg})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_gen})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_geom2d})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_gprim})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_la})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_mesh})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_occ})
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_stlgeom})
LIST( APPEND NETGEN_INCLUDE_DIRS
${NETGEN_DIR_csg} ${NETGEN_DIR_gen} ${NETGEN_DIR_geom2d}
${NETGEN_DIR_gprim} ${NETGEN_DIR_la} ${NETGEN_DIR_mesh}
${NETGEN_DIR_occ} ${NETGEN_DIR_stlgeom} )
-80
View File
@@ -1,80 +0,0 @@
# - Try to find the Open Dynamics Engine library
# Once done this will define:
#
# ODE_FOUND - system has the ODE library
# ODE_INCLUDE_DIRS - the ODE include directory (include ODE headers with <ode/headername.h>)
# ODE_LIBRARIES - the ODE library
# ODE_DEFINITIONS - additional definitions necessary to use ODE (usually the precision flag)
if (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
# ODE has already been found and the necessary variables are cached
set(ODE_FOUND TRUE)
else (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
# Find ODE
# Use PkgConfig if possible
if (NOT WIN32)
find_package(PkgConfig)
pkg_check_modules(PC_ODE ode)
endif (NOT WIN32)
# Find include dir
find_path(ODE_INCLUDE_DIRS ode/ode.h
HINTS ${PC_ODE_INCLUDEDIR}
PATHS $ENV{OGRE_HOME}/include # ODE is shipped with the OGRE SDK
)
find_library(ODE_LIBRARIES ode
NAMES ode ${PC_ODE_LIBRARIES}
HINTS ${PC_ODE_LIBDIR}
PATHS $ENV{OGRE_HOME}/lib
)
# Decide if ODE was found
set(ODE_FOUND FALSE)
if (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
set(ODE_FOUND TRUE)
endif (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
# Find out extra definitions needed for ODE.
# This is mostly needed for the ODE's precision selector:
# ODE can be built either in single-precision (default) or double-precision mode. The app has
# to be built in the same mode, otherwise things will crash.
if (ODE_FOUND)
# If PkgConfig found anything, then use its results, otherwise use ode-config script
if (PC_ODE_FOUND)
# Take the definitions from PkgConfig results
set(ODE_DEFINITIONS ${PC_ODE_CFLAGS_OTHER} CACHE STRING "")
set(ODE_DEFINITIONS_FOUND TRUE)
else (PC_ODE_FOUND)
# Try to use ode-config
find_program(ODECONFIG_EXECUTABLE ode-config)
if (ODECONFIG_EXECUTABLE)
execute_process(COMMAND ${ODECONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ODECONFIG_CFLAGS)
set(ODE_DEFINITIONS ${ODECONFIG_CFLAGS} CACHE STRING "")
set(ODE_DEFINITIONS_FOUND TRUE)
endif (ODECONFIG_EXECUTABLE)
endif (PC_ODE_FOUND)
endif (ODE_FOUND)
# Show messages
if (ODE_FOUND)
if (NOT ODE_FIND_QUIETLY)
message(STATUS "Found ODE: ${ODE_LIBRARIES}")
# Show the ODE precision if the definitions were detected
if (ODE_DEFINITIONS_FOUND)
if (ODE_DEFINITIONS MATCHES -DdDOUBLE)
message(STATUS "ODE uses double precision")
else (ODE_DEFINITIONS MATCHES -DdDOUBLE)
message(STATUS "ODE uses single precision")
endif (ODE_DEFINITIONS MATCHES -DdDOUBLE)
else (ODE_DEFINITIONS_FOUND)
message(STATUS "Warning: couldn't determine ODE's precision")
endif (ODE_DEFINITIONS_FOUND)
endif (NOT ODE_FIND_QUIETLY)
else (ODE_FOUND)
if (ODE_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find ODE")
endif (ODE_FIND_REQUIRED)
endif (ODE_FOUND)
endif(ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
+15 -2
View File
@@ -9,7 +9,14 @@
# First try to find OpenCASCADE Community Edition
if(NOT DEFINED OCE_DIR)
if(UNIX)
# Check for OSX needs to come first because UNIX evaluates to true on OSX
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(DEFINED MACPORTS_PREFIX)
find_package(OCE HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
elseif(DEFINED HOMEBREW_PREFIX)
find_package(OCE HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
endif()
elseif(UNIX)
set(OCE_DIR "/usr/local/share/cmake/")
elseif(WIN32)
set(OCE_DIR "c:/OCE-0.4.0/share/cmake")
@@ -60,6 +67,11 @@ else(OCE_FOUND) #look for OpenCASCADE
endif(WIN32)
if(OCC_LIBRARY)
GET_FILENAME_COMPONENT(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
IF(NOT OCC_INCLUDE_DIR)
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
${OCC_LIBRARY_DIR}/../inc
)
ENDIF()
endif(OCC_LIBRARY)
endif(OCE_FOUND)
@@ -97,6 +109,7 @@ if(OCC_FOUND)
TKSTL
TKShHealing
TKXSBase
TKBin
TKBool
TKBO
TKBRep
@@ -126,5 +139,5 @@ if(OCC_FOUND)
message(STATUS "-- OCE/OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
message(STATUS "-- OCE/OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
else(OCC_FOUND)
message("Neither OpenCASCADE Community Edition nor OpenCasCade were found: will not build CAD modules!")
#message(SEND_ERROR "Neither OpenCASCADE Community Edition nor OpenCasCade were found: will not build CAD modules!")
endif(OCC_FOUND)
+33 -16
View File
@@ -14,17 +14,14 @@ IF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
set(PYSIDE_TOOLS_FOUND_QUIETLY TRUE)
ENDIF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
if(WIN32 OR APPLE)
if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#pyside tools are often in same location as python interpreter
get_filename_component(PYTHON_BIN_DIR ${PYTHON_EXECUTABLE} PATH)
set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
endif(WIN32 OR APPLE)
endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic HINTS ${PYSIDE_BIN_DIR})
FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc HINTS ${PYSIDE_BIN_DIR})
#message(STATUS "PYSIDEUIC4BINARY ${PYSIDEUIC4BINARY}" )
#message(STATUS "PYSIDERCC4BINARY ${PYSIDERCC4BINARY}" )
FIND_PROGRAM(PYSIDEUIC4BINARY NAMES python2-pyside-uic pyside-uic pyside-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
FIND_PROGRAM(PYSIDERCC4BINARY NAMES pyside-rcc pyside-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
MACRO(PYSIDE_WRAP_UI outfiles)
FOREACH(it ${ARGN})
@@ -34,10 +31,20 @@ MACRO(PYSIDE_WRAP_UI outfiles)
#ADD_CUSTOM_TARGET(${it} ALL
# DEPENDS ${outfile}
#)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
if(WIN32)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
else(WIN32)
# Especially on Open Build Service we don't want changing date like
# pyside-uic generates in comments at beginning.
EXECUTE_PROCESS(
COMMAND ${PYSIDEUIC4BINARY} ${infile}
COMMAND sed "/^# /d"
OUTPUT_FILE ${outfile}
)
endif(WIN32)
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH(it)
ENDMACRO (PYSIDE_WRAP_UI)
@@ -50,10 +57,20 @@ MACRO(PYSIDE_WRAP_RC outfiles)
#ADD_CUSTOM_TARGET(${it} ALL
# DEPENDS ${outfile}
#)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
if(WIN32)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
else(WIN32)
# Especially on Open Build Service we don't want changing date like
# pyside-rcc generates in comments at beginning.
EXECUTE_PROCESS(
COMMAND ${PYSIDERCC4BINARY} ${infile}
COMMAND sed "/^# /d"
OUTPUT_FILE ${outfile}
)
endif(WIN32)
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH(it)
ENDMACRO (PYSIDE_WRAP_RC)
@@ -68,7 +85,7 @@ if(PYSIDERCC4BINARY AND PYSIDEUIC4BINARY)
endif (NOT PySideTools_FIND_QUIETLY)
else(PYSIDERCC4BINARY AND PYSIDEUIC4BINARY)
if(PySideTools_FIND_REQUIRED)
message(FATAL_ERROR "PySideTools could not be not found, but are required.")
message(FATAL_ERROR "PySideTools could not be found, but are required.")
else(PySideTools_FIND_REQUIRED)
if (NOT PySideTools_FIND_QUIETLY)
message(STATUS "PySideTools: not found.")
-115
View File
@@ -1,115 +0,0 @@
#############################################################################
# Description:
# Try to find SoQt library.
# Once run this will define:
#
# SOQT_FOUND
# SOQT_LIBRARIES
# SOQT_LIBRARY_RELEASE
# SOQT_LIBRARY_DEBUG
#
#############################################################################
IF(UNIX OR WIN32)
IF(WIN32)
IF(MINGW)
FIND_LIBRARY(SOQT_LIBRARY
NAMES SoQt #only shared libraries under windows
PATHS
/usr/lib
/usr/local/lib
/lib
"$ENV{COINDIR}/lib"
)
ELSE(MINGW)
FIND_LIBRARY(SOQT_LIBRARY_RELEASE
#only shared libraries under windows
NAMES soqt1
PATHS
"$ENV{COINDIR}/lib"
)
FIND_LIBRARY(SOQT_LIBRARY_DEBUG
NAMES soqt1d #only shared libraries under windows
PATHS
"$ENV{COINDIR}/lib"
)
FIND_PATH(SOQT_INCLUDE_PATH Inventor/Qt/SoQt.h
"$ENV{COINDIR}/include"
"$ENV{INCLUDE}"
)
MARK_AS_ADVANCED(
SOQT_LIBRARY_DEBUG
SOQT_LIBRARY_RELEASE
SOQT_INCLUDE_PATH
)
ENDIF(MINGW)
ELSE(WIN32)
FIND_LIBRARY(SOQT_LIBRARY
NAMES SoQt #only shared libraries under windows
PATHS
/usr/lib
/usr/local/lib
/lib
"$ENV{COINDIR}/lib"
)
#MESSAGE(STATUS "DBG SOQT_LIBRARY=${SOQT_LIBRARY}")
ENDIF(WIN32)
## --------------------------------
IF(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
IF(WIN32)
IF(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG)
SET(SOQT_LIBRARY_RELEASE ${SOQT_LIBRARY_RELEASE})
ENDIF(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG)
IF(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE)
SET(SOQT_LIBRARY_DEBUG ${SOQT_LIBRARY_DEBUG})
ENDIF(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE)
IF(SOQT_LIBRARY_RELEASE AND SOQT_LIBRARY_DEBUG)
SET(SOQT_LIBRARY_RELEASE ${SOQT_LIBRARY_RELEASE})
SET(SOQT_LIBRARY_DEBUG ${SOQT_LIBRARY_DEBUG})
ENDIF(SOQT_LIBRARY_RELEASE AND SOQT_LIBRARY_DEBUG)
IF(MINGW)
SET(SOQT_LIBRARIES ${SOQT_LIBRARY})
MARK_AS_ADVANCED(
SOQT_LIBRARIES
SOQT_LIBRARY
)
ENDIF(MINGW)
ELSE(WIN32)
SET(SOQT_LIBRARIES ${SOQT_LIBRARY})
MARK_AS_ADVANCED(
SOQT_LIBRARIES
SOQT_LIBRARY
)
ENDIF(WIN32)
SET(SOQT_FOUND TRUE)
ELSE(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
SET(SOQT_FOUND FALSE)
#MESSAGE("SoQt library not found.")
ENDIF(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
IF(WIN32)
IF(SOQT_INCLUDE_PATH)
set(SOQT_INCLUDE_DIR ${SOQT_INCLUDE_PATH})
ELSE(SOQT_INCLUDE_PATH)
#MESSAGE("Can not find SoQt includes")
ENDIF(SOQT_INCLUDE_PATH)
MARK_AS_ADVANCED(
SOQT_INCUDE_DIR
)
ENDIF(WIN32)
#MESSAGE(STATUS "SOQT_FOUND : ${SOQT_FOUND}")
ELSE(UNIX OR WIN32)
SET(SOQT_FOUND FALSE)
ENDIF(UNIX OR WIN32)
+12 -12
View File
@@ -4,11 +4,11 @@
# Modified by Jos van den Oever
# This module defines
# XERCESC_INCLUDE_DIR, where to find ptlib.h, etc.
# XERCESC_LIBRARIES, the libraries to link against to use pwlib.
# XERCESC_FOUND, If false, don't try to use pwlib.
# XercesC_INCLUDE_DIRS, where to find ptlib.h, etc.
# XercesC_LIBRARIES, the libraries to link against to use pwlib.
# XercesC_FOUND, If false, don't try to use pwlib.
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp
FIND_PATH(XercesC_INCLUDE_DIRS xercesc/dom/DOM.hpp
"[HKEY_CURRENT_USER\\software\\xerces-c\\src]"
"[HKEY_CURRENT_USER\\xerces-c\\src]"
$ENV{XERCESCROOT}/src/
@@ -16,7 +16,7 @@ FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp
/usr/include
)
FIND_LIBRARY(XERCESC_LIBRARIES
FIND_LIBRARY(XercesC_LIBRARIES
NAMES
xerces-c
PATHS
@@ -28,21 +28,21 @@ FIND_LIBRARY(XERCESC_LIBRARIES
)
# if the include a the library are found then we have it
IF(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
SET(XERCESC_FOUND "YES" )
IF(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
SET(XercesC_FOUND "YES" )
IF(NOT XERCESC__FIND_QUIETLY)
MESSAGE(STATUS "Found Xerces-C: ${XERCESC_LIBRARIES}")
MESSAGE(STATUS "Found Xerces-C: ${XercesC_LIBRARIES}")
ENDIF(NOT XERCESC__FIND_QUIETLY)
ELSE(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
ELSE(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
IF(XERCESC_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Xerces-C was not found.")
ENDIF(XERCESC_FIND_REQUIRED)
IF(NOT XERCESC__FIND_QUIETLY)
MESSAGE(STATUS "Xerces-C was not found.")
ENDIF(NOT XERCESC__FIND_QUIETLY)
ENDIF(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
ENDIF(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
#MARK_AS_ADVANCED(
# XERCESC_INCLUDE_DIR
# XERCESC_LIBRARIES
# XercesC_INCLUDE_DIRS
# XercesC_LIBRARIES
#)
+11 -4
View File
@@ -222,24 +222,28 @@ MACRO(SET_BIN_DIR ProjectName OutputName)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}${ARGV2})
else(${ARGC} GREATER 2)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
endif(${ARGC} GREATER 2)
if(WIN32)
set_target_properties(${ProjectName} PROPERTIES DEBUG_OUTPUT_NAME ${OutputName}_d)
else(WIN32)
# FreeCADBase, SMDS, Driver and MEFISTO2 libs don't depend on parts from CMAKE_INSTALL_LIBDIR
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2)$")
# FreeCADBase, SMDS, Driver, MEFISTO2 and area libs don't depend on parts from CMAKE_INSTALL_LIBDIR
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2|area)$")
if(${ARGC} STREQUAL 4)
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}${ARGV3})
else(${ARGC} STREQUAL 4)
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_LIBDIR})
endif(${ARGC} STREQUAL 4)
endif(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2)$")
endif()
endif()
endif(WIN32)
ENDMACRO(SET_BIN_DIR)
@@ -251,5 +255,8 @@ MACRO(SET_PYTHON_PREFIX_SUFFIX ProjectName)
if(WIN32)
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".pyd")
# 0000661: cmake build on Mac OS: dealing with dylib versus so
elseif(APPLE)
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".so")
endif(WIN32)
ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)
+24 -17
View File
@@ -11,16 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_LIBRARY optimized python27.lib debug python27_d.lib)
set(PYTHON_LIBRARIES optimized python27.lib debug python27_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.7.5)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.7.5)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.1)
set(XERCESC_LIBRARIES xerces-c_3.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.1)
set(XercesC_LIBRARIES xerces-c_3.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_55)
@@ -29,15 +30,15 @@ set(Boost_LIBRARIES
optimized boost_system-vc110-mt-1_55.lib
optimized boost_graph-vc110-mt-1_55.lib
optimized boost_program_options-vc110-mt-1_55.lib
optimized boost_python-vc110-mt-1_55.lib
optimized boost_regex-vc110-mt-1_55.lib
optimized boost_signals-vc110-mt-1_55.lib
optimized boost_thread-vc110-mt-1_55.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc110-mt-gd-1_55.lib
debug boost_system-vc110-mt-gd-1_55.lib
debug boost_graph-vc110-mt-gd-1_55.lib
debug boost_program_options-vc110-mt-gd-1_55.lib
debug boost_python-vc110-mt-gd-1_55.lib
debug boost_regex-vc110-mt-gd-1_55.lib
debug boost_signals-vc110-mt-gd-1_55.lib
debug boost_thread-vc110-mt-gd-1_55.lib
@@ -67,7 +68,7 @@ set(SMESH_FOUND TRUE)
# Coin3D
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
${FREECAD_LIBPACK_DIR}/include/Coin-4.0.0
)
find_library(COIN3D_LIBRARY_RELEASE coin4
@@ -76,6 +77,8 @@ find_library(COIN3D_LIBRARY_RELEASE coin4
find_library(COIN3D_LIBRARY_DEBUG coin4d
"${FREECAD_LIBPACK_DIR}/lib"
)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -117,8 +120,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -135,12 +136,20 @@ set(QT_QTCORE_LIBRARY
optimized QtCore4.lib debug QtCored4.lib
)
set(QT_QT3SUPPORT_LIBRARY_DEBUG
debug Qt3Supportd4.lib
set(QT_QTXML_LIBRARY
optimized QtXml4.lib debug QtXmld4.lib
)
set(QT_QT3SUPPORT_LIBRARY
optimized Qt3Support4.lib
optimized Qt3Support4.lib debug Qt3Supportd4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
@@ -422,6 +431,7 @@ set(OCC_LIBRARIES
optimized TKSTL
optimized TKShHealing
optimized TKXSBase
optimized TKBin
optimized TKBool
optimized TKBO
optimized TKBRep
@@ -447,6 +457,7 @@ set(OCC_DEBUG_LIBRARIES
debug TKSTLd
debug TKShHealingd
debug TKXSBased
debug TKBind
debug TKBoold
debug TKBOd
debug TKBRepd
@@ -485,10 +496,6 @@ set(OCC_FOUND TRUE)
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
set(EIGEN3_FOUND TRUE)
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
set(ODE_FOUND TRUE)
# FreeType
if(FREECAD_USE_FREETYPE)
set(FREETYPE_LIBRARIES
+28 -20
View File
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_DEBUG_LIBRARY python25_d.lib)
set(PYTHON_LIBRARY python25.lib)
set(PYTHON_LIBRARIES optimized python25.lib debug python25_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XERCESC_LIBRARIES xerces-c_2.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XercesC_LIBRARIES xerces-c_2.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
@@ -29,13 +29,13 @@ set(Boost_LIBRARIES
optimized boost_filesystem-vc80-mt.lib
#optimized boost_graph-vc80-mt.lib
optimized boost_program_options-vc80-mt.lib
optimized boost_python-vc80-mt.lib
optimized boost_regex-vc80-mt.lib
optimized boost_signals-vc80-mt.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc80-mt-gd.lib
#debug boost_graph-vc80-mt-gd.lib
debug boost_program_options-vc80-mt-gd.lib
debug boost_python-vc80-mt-gd.lib
debug boost_regex-vc80-mt-gd.lib
debug boost_signals-vc80-mt-gd.lib
)
@@ -63,9 +63,11 @@ set(SMESH_LIBRARIES
set(SMESH_FOUND TRUE)
# Coin3D
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_LIBRARY_DEBUG coin2d.lib)
set(COIN3D_LIBRARY_RELEASE coin2.lib)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -102,8 +104,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -116,12 +116,24 @@ set(QT_DEBUG_LIBRARIES
debug QtWebKitd4.lib
)
set(QT_QTCORE_LIBRARY_DEBUG
debug QtCored4.lib
)
set(QT_QTCORE_LIBRARY
optimized QtCore4.lib
debug QtCored4.lib
)
set(QT_QTXML_LIBRARY
optimized QtXml4.lib
debug QtXmld4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib
debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib
optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
@@ -272,11 +284,6 @@ set(OPENCV_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/opencv)
set(OPENCV_LIBRARIES cv.lib cvaux.lib cxcore.lib cxts.lib highgui.lib)
set(OPENCV_FOUND TRUE)
# ODE
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include)
set(ODE_LIBRARIES ode_double.lib)
set(ODE_FOUND TRUE)
# OCC
set(OCC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/OpenCascade)
set(OCC_LIBRARY_DIR
@@ -293,6 +300,7 @@ set(OCC_LIBRARIES
TKSTL
TKShHealing
TKXSBase
TKBin
TKBool
TKBO
TKBRep
+28 -15
View File
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
set(PYTHON_LIBRARY python26.lib)
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XERCESC_LIBRARIES xerces-c_2.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XercesC_LIBRARIES xerces-c_2.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
@@ -30,11 +30,10 @@ set(Boost_LIBRARIES
optimized boost_system-vc90-mt-1_39.lib
optimized boost_graph-vc90-mt-1_39.lib
optimized boost_program_options-vc90-mt-1_39.lib
optimized boost_python-vc90-mt-1_39.lib
optimized boost_regex-vc90-mt-1_39.lib
optimized boost_signals-vc90-mt-1_39.lib
optimized boost_thread-vc90-mt-1_39.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc90-mt-gd-1_39.lib
debug boost_date_time-vc90-mt-gd-1_39.lib
debug boost_filesystem-vc90-mt-gd-1_39.lib
@@ -45,6 +44,7 @@ set(Boost_DEBUG_LIBRARIES
debug boost_system-vc90-mt-gd-1_39.lib
debug boost_graph-vc90-mt-gd-1_39.lib
debug boost_program_options-vc90-mt-gd-1_39.lib
debug boost_python-vc90-mt-gd-1_39.lib
debug boost_regex-vc90-mt-gd-1_39.lib
debug boost_signals-vc90-mt-gd-1_39.lib
)
@@ -72,9 +72,11 @@ set(SMESH_LIBRARIES
set(SMESH_FOUND TRUE)
# Coin3D
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_LIBRARY_DEBUG coin3d.lib)
set(COIN3D_LIBRARY_RELEASE coin3.lib)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -111,8 +113,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -125,12 +125,24 @@ set(QT_DEBUG_LIBRARIES
debug QtWebKitd4.lib
)
set(QT_QTCORE_LIBRARY_DEBUG
debug QtCored4.lib
)
set(QT_QTCORE_LIBRARY
optimized QtCore4.lib
debug QtCored4.lib
)
set(QT_QTXML_LIBRARY
optimized QtXml4.lib
debug QtXmld4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib
debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib
optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
@@ -299,6 +311,7 @@ set(OCC_LIBRARIES
TKSTL
TKShHealing
TKXSBase
TKBin
TKBool
TKBO
TKBRep
+28 -11
View File
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
set(PYTHON_LIBRARY python26.lib)
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XERCESC_LIBRARIES xerces-c_2.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
set(XercesC_LIBRARIES xerces-c_2.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
@@ -30,11 +30,10 @@ set(Boost_LIBRARIES
optimized boost_system-vc90-mt-1_48.lib
optimized boost_graph-vc90-mt-1_48.lib
optimized boost_program_options-vc90-mt-1_48.lib
optimized boost_python-vc90-mt-1_48.lib
optimized boost_regex-vc90-mt-1_48.lib
optimized boost_signals-vc90-mt-1_48.lib
optimized boost_thread-vc90-mt-1_48.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc90-mt-gd-1_48.lib
debug boost_date_time-vc90-mt-gd-1_48.lib
debug boost_filesystem-vc90-mt-gd-1_48.lib
@@ -45,6 +44,7 @@ set(Boost_DEBUG_LIBRARIES
debug boost_system-vc90-mt-gd-1_48.lib
debug boost_graph-vc90-mt-gd-1_48.lib
debug boost_program_options-vc90-mt-gd-1_48.lib
debug boost_python-vc90-mt-gd-1_48.lib
debug boost_regex-vc90-mt-gd-1_48.lib
debug boost_signals-vc90-mt-gd-1_48.lib
)
@@ -84,9 +84,11 @@ set(ZLIB_FOUND TRUE)
#set(SMESH_FOUND TRUE)
# Coin3D
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
set(COIN3D_LIBRARY_DEBUG coin3d.lib)
set(COIN3D_LIBRARY_RELEASE coin3.lib)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -123,8 +125,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -142,6 +142,21 @@ set(QT_QTCORE_LIBRARY
debug QtCored4.lib
)
set(QT_QTXML_LIBRARY
optimized QtXml4.lib
debug QtXmld4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib
debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib
optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
set(QT_MOC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/moc.exe)
set(QT_RCC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/rcc.exe)
@@ -341,6 +356,7 @@ set(OCC_LIBRARIES
optimized TKSTL
optimized TKShHealing
optimized TKXSBase
optimized TKBin
optimized TKBool
optimized TKXSBase
optimized TKBO
@@ -376,6 +392,7 @@ set(OCC_DEBUG_LIBRARIES
debug TKSTLd
debug TKShHealingd
debug TKXSBased
debug TKBind
debug TKBoold
debug TKXSBased
debug TKBOd
+31 -25
View File
@@ -11,16 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_LIBRARY optimized python27.lib debug python27_d.lib)
set(PYTHON_LIBRARIES optimized python27.lib debug python27_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.7.6)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.7.6)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
set(XERCESC_LIBRARIES xerces-c_3.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
set(XercesC_LIBRARIES xerces-c_3.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_54)
@@ -29,15 +30,15 @@ set(Boost_LIBRARIES
optimized boost_system-vc90-mt-1_54.lib
optimized boost_graph-vc90-mt-1_54.lib
optimized boost_program_options-vc90-mt-1_54.lib
optimized boost_python-vc90-mt-1_54.lib
optimized boost_regex-vc90-mt-1_54.lib
optimized boost_signals-vc90-mt-1_54.lib
optimized boost_thread-vc90-mt-1_54.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc90-mt-gd-1_54.lib
debug boost_system-vc90-mt-gd-1_54.lib
debug boost_graph-vc90-mt-gd-1_54.lib
debug boost_program_options-vc90-mt-gd-1_54.lib
debug boost_python-vc90-mt-gd-1_54.lib
debug boost_regex-vc90-mt-gd-1_54.lib
debug boost_signals-vc90-mt-gd-1_54.lib
debug boost_thread-vc90-mt-gd-1_54.lib
@@ -66,24 +67,17 @@ set(SMESH_LIBRARIES
set(SMESH_FOUND TRUE)
# Coin3D
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
${FREECAD_LIBPACK_DIR}/include/Coin-2.4.5
)
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
${FREECAD_LIBPACK_DIR}/include/Coin-4.0.0
)
find_library(COIN3D_LIBRARY_RELEASE coin2
"${FREECAD_LIBPACK_DIR}/lib"
)
find_library(COIN3D_LIBRARY_DEBUG coin2d
"${FREECAD_LIBPACK_DIR}/lib"
)
find_library(COIN3D_LIBRARY_RELEASE coin4
"${FREECAD_LIBPACK_DIR}/lib"
)
find_library(COIN3D_LIBRARY_DEBUG coin4d
"${FREECAD_LIBPACK_DIR}/lib"
)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -110,6 +104,10 @@ set(QT_QTCORE_INCLUDE_DIR
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/QtCore
)
set(QT_QTXML_INCLUDE_DIR
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/QtXml
)
set(QT_QT3SUPPORT_INCLUDE_DIR
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/Qt3Support
)
@@ -125,8 +123,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -144,12 +140,24 @@ set(QT_QTCORE_LIBRARY
debug QtCored4.lib
)
set(QT_QT3SUPPORT_LIBRARY_DEBUG
debug Qt3Supportd4.lib
set(QT_QTXML_LIBRARY
optimized QtXml4.lib
debug QtXmld4.lib
)
set(QT_QT3SUPPORT_LIBRARY
optimized Qt3Support4.lib
debug Qt3Supportd4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib
debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib
optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
@@ -363,6 +371,7 @@ set(OCC_LIBRARIES
optimized TKSTL
optimized TKShHealing
optimized TKXSBase
optimized TKBin
optimized TKBool
optimized TKBO
optimized TKBRep
@@ -388,6 +397,7 @@ set(OCC_DEBUG_LIBRARIES
debug TKSTLd
debug TKShHealingd
debug TKXSBased
debug TKBind
debug TKBoold
debug TKBOd
debug TKBRepd
@@ -428,10 +438,6 @@ set(EIGEN2_FOUND TRUE)
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
set(EIGEN3_FOUND TRUE)
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
set(ODE_FOUND TRUE)
# FreeType
if(FREECAD_USE_FREETYPE)
set(FREETYPE_LIBRARIES
+5 -3
View File
@@ -12,12 +12,14 @@ set(PYTHON_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27.lib CACHE FILEPATH "" FOR
set(PYTHON_DEBUG_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27_d.lib CACHE FILEPATH "" FORCE)
set(PYTHON_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/python2.7 CACHE PATH "" FORCE)
find_library(XERCESC_LIBRARIES xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
find_library(XERCESC_DEBUG_LIBRARIES xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
set(XERCESC_FOUND TRUE)
find_library(XercesC_LIBRARIES xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
find_library(XercesC_DEBUG_LIBRARIES xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
set(XercesC_FOUND TRUE)
find_library(COIN3D_LIBRARY_RELEASE coin4 "${FREECAD_LIBPACK_DIR}/lib")
find_library(COIN3D_LIBRARY_DEBUG coin4d "${FREECAD_LIBPACK_DIR}/lib")
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
set(NETGENDATA ${FREECAD_LIBPACK_DIR}/include/netgen)
+29 -23
View File
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
set(OPENGL_gl_LIBRARY opengl32 glu32)
# Python
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
set(PYTHON_LIBRARY python26.lib)
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.6.4)
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.6.4)
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
set(PYTHONLIBS_FOUND TRUE)
# XercesC
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
set(XERCESC_LIBRARIES xerces-c_3.lib)
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XERCESC_FOUND TRUE)
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
set(XercesC_LIBRARIES xerces-c_3.lib)
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
set(XercesC_FOUND TRUE)
# Boost
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_41)
@@ -30,15 +30,15 @@ set(Boost_LIBRARIES
optimized boost_system-vc90-mt-1_41.lib
optimized boost_graph-vc90-mt-1_41.lib
optimized boost_program_options-vc90-mt-1_41.lib
optimized boost_python-vc90-mt-1_41.lib
optimized boost_regex-vc90-mt-1_41.lib
optimized boost_signals-vc90-mt-1_41.lib
optimized boost_thread-vc90-mt-1_41.lib
)
set(Boost_DEBUG_LIBRARIES
debug boost_filesystem-vc90-mt-gd-1_41.lib
debug boost_system-vc90-mt-gd-1_41.lib
debug boost_graph-vc90-mt-gd-1_41.lib
debug boost_program_options-vc90-mt-gd-1_41.lib
debug boost_python-vc90-mt-gd-1_41.lib
debug boost_regex-vc90-mt-gd-1_41.lib
debug boost_signals-vc90-mt-gd-1_41.lib
debug boost_thread-vc90-mt-gd-1_41.lib
@@ -67,10 +67,10 @@ set(SMESH_LIBRARIES
set(SMESH_FOUND TRUE)
# Coin3D
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
${FREECAD_LIBPACK_DIR}/include/Coin-2.4.5
)
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
${FREECAD_LIBPACK_DIR}/include/Coin-3.1.3
)
find_library(COIN3D_LIBRARY_RELEASE coin2
@@ -85,6 +85,8 @@ find_library(COIN3D_LIBRARY_RELEASE coin3
find_library(COIN3D_LIBRARY_DEBUG coin3d
"${FREECAD_LIBPACK_DIR}/lib"
)
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
set(COIN3D_FOUND TRUE)
@@ -126,8 +128,6 @@ set(QT_LIBRARIES
optimized QtXml4.lib
optimized QtOpenGl4.lib
optimized QtWebKit4.lib
)
set(QT_DEBUG_LIBRARIES
debug QtCored4.lib
debug QtGuid4.lib
debug QtDesignerd4.lib
@@ -140,20 +140,29 @@ set(QT_DEBUG_LIBRARIES
debug QtWebKitd4.lib
)
set(QT_QTCORE_LIBRARY_DEBUG
set(QT_QTCORE_LIBRARY
optimized QtCore4.lib
debug QtCored4.lib
)
set(QT_QTCORE_LIBRARY
optimized QtCore4.lib
)
set(QT_QT3SUPPORT_LIBRARY_DEBUG
debug Qt3Supportd4.lib
set(QT_QTXML_LIBRARY
optimized QtXml4.lib
debug QtXmld4.lib
)
set(QT_QT3SUPPORT_LIBRARY
optimized Qt3Support4.lib
debug Qt3Supportd4.lib
)
set(QT_QTUITOOLS_LIBRARY
optimized QtUiTools.lib
debug QtUiToolsd.lib
)
set(QT_QTMAIN_LIBRARY
debug qtmaind.lib
optimized qtmain.lib
)
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
@@ -367,6 +376,7 @@ set(OCC_LIBRARIES
TKSTL
TKShHealing
TKXSBase
TKBin
TKBool
TKBO
TKBRep
@@ -398,10 +408,6 @@ set(EIGEN2_FOUND TRUE)
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
set(EIGEN3_FOUND TRUE)
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
set(ODE_FOUND TRUE)
# FreeType
if(FREECAD_USE_FREETYPE)
set(FREETYPE_LIBRARIES
+1
View File
@@ -6,6 +6,7 @@ SET(Examples_Files
PartDesignExample.FCStd
RobotExample.FCStd
ArchDetail.FCStd
FemCalculixCantilever3D.FCStd
)
ADD_CUSTOM_TARGET(Example_data ALL
Binary file not shown.
+24
View File
@@ -1,3 +1,27 @@
freecad (0.15-1precise3) precise; urgency=low
* control: added netgen-headers to Build Depends.
-- Normand Chamberland <gemnoc@gmail.com> Sat, 04 Apr 2015 11:14:23 -0400
freecad (0.15-1precise2) precise; urgency=low
* control: added pyside-tools to build deps, broke down python-pyside depends
-- Normand Chamberland <gemnoc@gmail.com> Thu, 06 Nov 2014 22:10:44 -0500
freecad (0.15-1precise1) precise; urgency=low
* Bumped version number as per upstream version
-- Normand Chamberland <gemnoc@gmail.com> Thu, 07 Aug 2014 11:34:39 -0400
freecad (0.14-1precise2) precise; urgency=low
* Set new version number.
-- Werner Mayer <wmayer@users.sourceforge.net> Sat, 13 Jul 2013 12:53:55 +0200
freecad (0.13-1precise2) precise; urgency=low
* Fix hard dependency on libgl1-mesa-glx preventing installation on
+11 -10
View File
@@ -5,24 +5,25 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.
Uploaders: Teemu Ikonen <tpikonen@gmail.com>, "Adam C. Powell, IV" <hazelsct@debian.org>, Anton Gladky <gladky.anton@gmail.com>
Vcs-Browser: http://git.debian.org/?p=debian-science/packages/freecad.git
Vcs-Git: git://git.debian.org/git/debian-science/packages/freecad.git
Homepage: https://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Main_Page
Homepage: http://www.freecadweb.org/
Build-Depends: debhelper (>= 7.0.50~), cmake,
libboost-dev, libboost-date-time-dev, libboost-filesystem-dev,
libboost-graph-dev, libboost-iostreams-dev, libboost-program-options-dev,
libboost-regex-dev, libboost-serialization-dev, libboost-signals-dev,
libboost-thread-dev, libboost-python-dev, python-dev, python-support,
libqt4-dev, libxt-dev, libxext-dev, libxmu-dev, libxi-dev, libx11-dev,
libcoin80-dev, libsoqt4-dev, libeigen3-dev,
zlib1g-dev, libxerces-c-dev, liboce-foundation-dev,
liboce-modeling-dev, liboce-ocaf-dev,
liboce-visualization-dev, python-cxx-dev, libswscale-dev,
libzipios++-dev, swig, gfortran, f2c, libqtwebkit-dev, libspnav-dev, libfreetype6-dev,
libpyside-dev, libshiboken-dev, pyside-tools
Standards-Version: 3.9.1
libcoin60-dev, libsoqt4-dev, libeigen3-dev,
zlib1g-dev, libxerces-c2-dev, liboce-foundation-dev,
liboce-modeling-dev, liboce-ocaf-dev, liboce-visualization-dev,
python-cxx-dev, libswscale-dev, libzipios++-dev, swig, gfortran,
f2c, libqtwebkit-dev, libspnav-dev, libfreetype6-dev, libfreeimage-dev,
libpyside-dev, libshiboken-dev, pyside-tools, netgen-headers
Standards-Version: 3.9.3
Package: freecad
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-pyside.qtcore,
python-pyside.qtsvg, python-pyside.qtuitools
Recommends: python-pivy, python
Suggests: freecad-doc
Description: Extensible Open Source CAx program (beta)
@@ -62,7 +63,7 @@ Description: FreeCAD documentation
.
This package contains the FreeCAD documentation.
.
The documentation is provided in Qt help format;
The documentation is provided in Qt's new help format;
the new help format version can be viewed in conjunction with the Qt Assistant
found in the qt4-dev-tools package.
+2 -2
View File
@@ -1,5 +1,5 @@
Format-Specification: http://dep.debian.net/deps/dep5/
Maintainer: Werner Mayer <wmayer@users.sourceforge.net>
Format: http://dep.debian.net/deps/dep5/
Upstream-Contact: Werner Mayer <wmayer@users.sourceforge.net>
X-Packaged-By: Werner Mayer <wmayer@users.sourceforge.net>
X-Packaged-Date: 2006-09-26_16:55:15+02:00
Source: http://sourceforge.net/projects/free-cad
-1
View File
@@ -4,5 +4,4 @@ usr/share/icons/hicolor/48x48/apps
usr/share/icons/hicolor/64x64/apps
usr/share/icons/hicolor/scalable/apps
usr/share/icons/hicolor/64x64/mimetypes
usr/share/pixmaps
+2 -5
View File
@@ -11,8 +11,5 @@ Abstract: FreeCAD is a general purpose Open Source 3D
Section: Science/Engineering
Format: HTML
Index: /usr/share/doc/freecad/Start_Page.html
Files: /usr/share/doc/freecad/*.q*
Format: PDF
Files: /usr/share/doc/freecad/kr_16.pdf.gz /usr/share/doc/freecad/kr_210_2.pdf.gz /usr/share/doc/freecad/kr_500_2.pdf.gz
Index: /usr/share/doc/freecad-doc/Start_Page.html
Files: /usr/share/doc/freecad-doc/*.q*
+1 -1
View File
@@ -1 +1 @@
debian/tmp/usr/doc/*
debian/tmp/usr/lib/freecad/doc/*
+1 -1
View File
@@ -15,7 +15,7 @@
file formats such as STEP, IGES, STL and others.</p>
</description>
<screenshots>
<screenshot type="default" width="800" height="600">http://www.freecadweb.org/wiki/index.php?title=File:FreeCAD011.png</screenshot>
<screenshot type="default" width="800" height="600">http://www.freecadweb.org/wiki/images/5/56/Freecad_jeep.png</screenshot>
</screenshots>
<url type="homepage">http://www.freecadweb.org</url>
<updatecontact>yorik@uncreated.net</updatecontact>
+6
View File
@@ -0,0 +1,6 @@
debian/freecad.desktop usr/share/applications
debian/menu usr/share/menu/freecad
usr/share/freecad
usr/lib/freecad/bin
usr/lib/freecad/Mod
usr/lib/freecad/lib
+1
View File
@@ -0,0 +1 @@
freecad: binary-or-shlib-defines-rpath
+1
View File
@@ -1 +1,2 @@
debian/freecad.1
debian/mime/freecad-thumbnailer.1
+1 -1
View File
@@ -2,5 +2,5 @@
section="Applications/Science/Engineering"\
title="FreeCAD"\
command="/usr/bin/freecad"\
icon="/usr/share/pixmaps/freecad.xpm"
icon="/usr/share/freecad/freecad.xpm"
+29 -88
View File
@@ -1,100 +1,41 @@
#!/usr/bin/make -f
# -*- makefile -*-
%:
dh $@ --buildsystem=cmake --parallel --with python2
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# For testing: fakeroot debian/rules binary
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
configure:
dh_testdir
cmake . \
extra_flags += \
-DFREECAD_BUILD_DEBIAN=ON \
-DCMAKE_INSTALL_PREFIX=/usr/lib/freecad \
-DCMAKE_INSTALL_MANDIR=/usr/share/man \
-DCMAKE_INSTALL_INFODIR=/usr/share/info \
-DCMAKE_INSTALL_DATADIR=/usr/share/freecad \
-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/freecad \
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/freecad
-DBUILD_FEM_NETGEN=ON \
-DCMAKE_CXX_FLAGS="-Wall -DHAVE_SWIG=1 -fpermissive $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
-DCMAKE_C_FLAGS="-Wall -fpermissive $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
-DCMAKE_SHARED_LINKER_FLAGS="$(shell dpkg-buildflags --get LDFLAGS)" \
-DLIB_SUFFIX="" \
-DOCC_INCLUDE_DIR="/usr/include/oce" \
-DCMAKE_INSTALL_PREFIX="/usr/lib/freecad" \
-DCMAKE_INSTALL_DATADIR="/usr/share/freecad"
build: build-stamp
build-stamp: configure
dh_testdir
$(MAKE)
touch $@
clean:
dh clean
rm -f build-stamp
find -name '*.pyc' | xargs rm -f
find -name 'moc_*.cpp' | xargs rm -f
find -name 'ui_*.h' | xargs rm -f
find -name 'CMakeFiles' | xargs rm -rf
rm -f stamp-h1
install: build install-stamp
install-stamp:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install/fast DESTDIR=$(CURDIR)/debian/tmp/freecad
# install the core system
dh_install -pfreecad debian/tmp/freecad/usr/share/freecad/* usr/share/freecad/
# Desktop icons
dh_install -pfreecad debian/tmp/freecad/usr/share/freecad/freecad.xpm usr/share/pixmaps
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-16.png debian/freecad/usr/share/icons/hicolor/16x16/apps/freecad.png
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/32x32/apps/freecad.png
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/48x48/apps/freecad.png
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-64.png debian/freecad/usr/share/icons/hicolor/64x64/apps/freecad.png
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad.svg debian/freecad/usr/share/icons/hicolor/scalable/apps/freecad.svg
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-doc.png debian/freecad/usr/share/icons/hicolor/64x64/mimetypes/application-x-extension-fcstd.png
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/bin usr/lib/freecad
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/lib usr/lib/freecad
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/Mod usr/lib/freecad
dh_install debian/freecad.desktop usr/share/applications
dh_installman debian/freecad.1 debian/mime/freecad-thumbnailer.1
dh_installchangelogs ChangeLog.txt
# install the gnome app file
df_install debian/freecad.appdata.xml debian/freecad/usr/share/appdata
# install the headers
#dh_install -pfreecad-dev debian/tmp/freecad/usr/include/* usr/include
# install the help system
dh_install -pfreecad-doc debian/tmp/freecad/usr/share/doc/* usr/share/doc/
# install MIME stuff
dh_install debian/mime/freecad-thumbnailer usr/bin
dh_install debian/mime/freecad.thumbnailer usr/share/thumbnailers
dh_install debian/mime/freecad.schemas etc/gconf/schemas
dh_gconf -pfreecad
dh_installmime
touch install-stamp
override_dh_auto_configure:
dh_auto_configure -- $(extra_flags)
cp -f src/Build/Version.h obj-$(DEB_BUILD_GNU_TYPE)/src/Build/Version.h
override_dh_compress:
dh_compress -X.qch -X.qhc
override_dh_makeshlibs:
override_dh_installchangelogs:
dh_installchangelogs ChangeLog.txt
override_dh_installmime:
dh_installmime
dh_install debian/mime/freecad-thumbnailer usr/bin
dh_install debian/mime/freecad.thumbnailer usr/share/thumbnailers
dh_install debian/mime/freecad.schemas etc/gconf/schemas
override_dh_icons:
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-16.png debian/freecad/usr/share/icons/hicolor/16x16/apps/freecad.png
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/32x32/apps/freecad.png
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/48x48/apps/freecad.png
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-64.png debian/freecad/usr/share/icons/hicolor/64x64/apps/freecad.png
install -m 644 debian/freecad/usr/share/freecad/freecad.svg debian/freecad/usr/share/icons/hicolor/scalable/apps/freecad.svg
install -m 644 debian/freecad/usr/share/freecad/freecad-doc.png debian/freecad/usr/share/icons/hicolor/64x64/mimetypes/application-x-extension-fcstd.png
binary-indep: build install
dh binary-indep
binary-arch: build install
dh binary-arch
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
-1
View File
@@ -1 +0,0 @@
add_subdirectory(src)
-47
View File
@@ -1,47 +0,0 @@
ANN: Approximate Nearest Neighbors
Version: 1.1.1
Release Date: Aug 4, 2006
----------------------------------------------------------------------------
Copyright (c) 1997-2005 University of Maryland and Sunil Arya and David
Mount All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser Public License for more details.
A copy of the terms and conditions of the license can be found in
License.txt or online at
http://www.gnu.org/copyleft/lesser.html
To obtain a copy, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Disclaimer
----------
The University of Maryland and the authors make no representations about
the suitability or fitness of this software for any purpose. It is
provided "as is" without express or implied warranty.
---------------------------------------------------------------------
Authors
-------
David Mount
Dept of Computer Science
University of Maryland,
College Park, MD 20742 USA
mount@cs.umd.edu
http://www.cs.umd.edu/~mount/
Sunil Arya
Dept of Computer Science
Hong University of Science and Technology
Clearwater Bay, HONG KONG
arya@cs.ust.hk
http://www.cs.ust.hk/faculty/arya/
-450
View File
@@ -1,450 +0,0 @@
----------------------------------------------------------------------
The ANN Library (all versions) is provided under the terms and
conditions of the GNU Lesser General Public Library, which is stated
below. It can also be found at:
http://www.gnu.org/copyleft/lesser.html
----------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence the
version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public Licenses are
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the Free
Software Foundation and other authors who decide to use it. You can use
it too, but we suggest you first think carefully about whether this
license or the ordinary General Public License is the better strategy to
use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish); that you receive source code or can get it if
you want it; that you can change the software and use pieces of it in
new free programs; and that you are informed that you can do these
things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for you
if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or
for a fee, you must give the recipients all the rights that we gave you.
You must make sure that they, too, receive or can get the source code.
If you link other code with the library, you must provide complete
object files to the recipients, so that they can relink them with the
library after making changes to the library and recompiling it. And you
must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is
no warranty for the free library. Also, if the library is modified by
someone else and passed on, the recipients should know that what they
have is not the original version, so that the original author's
reputation will not be affected by problems that might be introduced by
others.
Finally, software patents pose a constant threat to the existence of any
free program. We wish to make sure that a company cannot effectively
restrict the users of a free program by obtaining a restrictive license
from a patent holder. Therefore, we insist that any patent license
obtained for a version of the library must be consistent with the full
freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License. This license, the GNU Lesser General Public
License, applies to certain designated libraries, and is quite different
from the ordinary General Public License. We use this license for
certain libraries in order to permit linking those libraries into
non-free programs.
When a program is linked with a library, whether statically or using a
shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the entire
combination fits its criteria of freedom. The Lesser General Public
License permits more lax criteria for linking other code with the
library.
We call this license the "Lesser" General Public License because it does
Less to protect the user's freedom than the ordinary General Public
License. It also provides other free software developers Less of an
advantage over competing non-free programs. These disadvantages are the
reason we use the ordinary General Public License for many libraries.
However, the Lesser license provides advantages in certain special
circumstances.
For example, on rare occasions, there may be a special need to encourage
the widest possible use of a certain library, so that it becomes a
de-facto standard. To achieve this, non-free programs must be allowed to
use the library. A more frequent case is that a free library does the
same job as widely used non-free libraries. In this case, there is
little to gain by limiting the free library to free software only, so we
use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of free
software. For example, permission to use the GNU C Library in non-free
programs enables many more people to use the whole GNU operating system,
as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is linked
with the Library has the freedom and the wherewithal to run that program
using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or other
authorized party saying it may be distributed under the terms of this
Lesser General Public License (also called "this License"). Each
licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which
has been distributed under these terms. A "work based on the Library"
means either the Library or any derivative work under copyright law:
that is to say, a work containing the Library or a portion of it, either
verbatim or with modifications and/or translated straightforwardly into
another language. (Hereinafter, translation is included without
limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making
modifications to it. For a library, complete source code means all the
source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and
installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running
a program using the Library is not restricted, and output from such a
program is covered only if its contents constitute a work based on the
Library (independent of the use of the Library in a tool for writing
it). Whether that is true depends on what the Library does and what the
program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the notices
that refer to this License and to the absence of any warranty; and
distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of
it, thus forming a work based on the Library, and copy and distribute
such modifications or work under the terms of Section 1 above, provided
that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the application.
Therefore, Subsection 2d requires that any application-supplied function
or table used by this function must be optional: if the application does
not supply it, the square root function must still compute square
roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library, and
can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based on
the Library, the distribution of the whole must be on the terms of this
License, whose permissions for other licensees extend to the entire
whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or
contest your rights to work written entirely by you; rather, the intent
is to exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the
Library with the Library (or with a work based on the Library) on a
volume of a storage or distribution medium does not bring the other work
under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so that
they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in these
notices.
Once this change is made in a given copy, it is irreversible for that
copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the
Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative
of it, under Section 2) in object code or executable form under the
terms of Sections 1 and 2 above provided that you accompany it with the
complete corresponding machine-readable source code, which must be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange.
If distribution of object code is made by offering access to copy from a
designated place, then offering equivalent access to copy the source
code from the same place satisfies the requirement to distribute the
source code, even though third parties are not compelled to copy the
source along with the object code.
5. A program that contains no derivative of any portion of the Library,
but is designed to work with the Library by being compiled or linked
with it, is called a "work that uses the Library". Such a work, in
isolation, is not a derivative work of the Library, and therefore falls
outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates
an executable that is a derivative of the Library (because it contains
portions of the Library), rather than a "work that uses the library".
The executable is therefore covered by this License. Section 6 states
terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be linked
without the Library, or if the work is itself a library. The threshold
for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure
layouts and accessors, and small macros and small inline functions (ten
lines or less in length), then the use of the object file is
unrestricted, regardless of whether it is legally a derivative work.
(Executables containing this object code plus portions of the Library
will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6, whether
or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a
"work that uses the Library" with the Library to produce a work
containing portions of the Library, and distribute that work under terms
of your choice, provided that the terms permit modification of the work
for the customer's own use and reverse engineering for debugging such
modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work during
execution displays copyright notices, you must include the copyright
notice for the Library among them, as well as a reference directing the
user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood that
the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library"
must include any data and utility programs needed for reproducing the
executable from it. However, as a special exception, the materials to be
distributed need not include anything that is normally distributed (in
either source or binary form) with the major components (compiler,
kernel, and so on) of the operating system on which the executable runs,
unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions
of other proprietary libraries that do not normally accompany the
operating system. Such a contradiction means you cannot use both them
and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library
side-by-side in a single library together with other library facilities
not covered by this License, and distribute such a combined library,
provided that the separate distribution of the work based on the Library
and of the other library facilities is otherwise permitted, and provided
that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the
Library except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, link with, or distribute the
Library is void, and will automatically terminate your rights under this
License. However, parties who have received copies, or rights, from you
under this License will not have their licenses terminated so long as
such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and all
its terms and conditions for copying, distributing or modifying the
Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot distribute
so as to satisfy simultaneously your obligations under this License and
any other pertinent obligations, then as a consequence you may not
distribute the Library at all. For example, if a patent license would
not permit royalty-free redistribution of the Library by all those who
receive copies directly or indirectly through you, then the only way you
could satisfy both it and this License would be to refrain entirely from
distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is implemented
by public license practices. Many people have made generous
contributions to the wide range of software distributed through that
system in reliance on consistent application of that system; it is up to
the author/donor to decide if he or she is willing to distribute
software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to be
a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may
add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among countries
not thus excluded. In such case, this License incorporates the
limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions
of the Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a license
version number, you may choose any version ever published by the Free
Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free Software
Foundation; we sometimes make exceptions for this. Our decision will be
guided by the two goals of preserving the free status of all derivatives
of our free software and of promoting the sharing and reuse of software
generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH
YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-46
View File
@@ -1,46 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll\dll.vcproj", "{A7D00B21-CB9C-4BBB-8DEE-51025104F867}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample\sample.vcproj", "{C76F5A10-7A4A-4546-9414-296DB38BE825}"
ProjectSection(ProjectDependencies) = postProject
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{6AC673C7-7B3F-4520-A761-647B212A4BEF}"
ProjectSection(ProjectDependencies) = postProject
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ann2fig", "ann2fig\ann2fig.vcproj", "{622DD7D8-0C0A-4303-9176-C9A8AF467E70}"
ProjectSection(ProjectDependencies) = postProject
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Debug|Win32.ActiveCfg = Debug|Win32
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Debug|Win32.Build.0 = Debug|Win32
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Release|Win32.ActiveCfg = Release|Win32
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Release|Win32.Build.0 = Release|Win32
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Debug|Win32.ActiveCfg = Debug|Win32
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Debug|Win32.Build.0 = Debug|Win32
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Release|Win32.ActiveCfg = Release|Win32
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Release|Win32.Build.0 = Release|Win32
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Debug|Win32.ActiveCfg = Debug|Win32
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Debug|Win32.Build.0 = Debug|Win32
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Release|Win32.ActiveCfg = Release|Win32
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Release|Win32.Build.0 = Release|Win32
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Debug|Win32.ActiveCfg = Debug|Win32
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Debug|Win32.Build.0 = Debug|Win32
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Release|Win32.ActiveCfg = Release|Win32
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-53
View File
@@ -1,53 +0,0 @@
#-----------------------------------------------------------------------------
# Makefile for Windows Versions.
#
# ANN: Approximate Nearest Neighbors
# Version: 1.1.1 08/04/06
#-----------------------------------------------------------------------------
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
# David Mount. All Rights Reserved.
#
# This software and related documentation is part of the Approximate
# Nearest Neighbor Library (ANN). This software is provided under
# the provisions of the Lesser GNU Public License (LGPL). See the
# file ../ReadMe.txt for further information.
#
# The University of Maryland (U.M.) and the authors make no
# representations about the suitability or fitness of this software for
# any purpose. It is provided "as is" without express or implied
# warranty.
#-----------------------------------------------------------------------------
# Revision 1.0 05/03/05
# Initial release
# Revision 1.1.1 08/04/06
# Added copyright/license
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# This is not used for compiling the dll. It is just used for cleaning
# things up for distribution. For compilcation, open the Ann.sln
# solution file in Microsoft Windows Visual Studio.NET.
#-----------------------------------------------------------------------------
default:
@echo "Enter one of the following:"
@echo " make clean remove object files"
@echo " make realclean remove library and executable files"
@echo " "
@echo "See file Makefile for other compilation options."
#-----------------------------------------------------------------------------
# Remove .o files and core files
#-----------------------------------------------------------------------------
clean:
-rm -f -r ann2fig/Debug ann2fig/Release
-rm -f -r dll/Debug dll/Release
-rm -f -r sample/Debug sample/Release
-rm -f -r test/Debug test/Release
-rm -f Ann.ncb Ann.suo
#-----------------------------------------------------------------------------
# Remove everthing that can be remade
#-----------------------------------------------------------------------------
realclean: clean
-rm -f bin/*
@@ -1,134 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="ann2fig"
ProjectGUID="{622DD7D8-0C0A-4303-9176-C9A8AF467E70}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\ann2fig.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/ann2fig.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\ann2fig.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\ann2fig\ann2fig.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
-452
View File
@@ -1,452 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="dll"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;ANN_PERF;ANN_NO_RANDOM"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/dll.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\ANN.dll"
LinkIncremental="0"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug\ANN.pdb"
ImportLibrary=".\Debug\ANN.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/dll.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;ANN_NO_RANDOM"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/dll.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\ANN.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release\ANN.pdb"
ImportLibrary=".\Release\ANN.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/dll.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\..\src\ANN.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\bd_fix_rad_search.cpp">
</File>
<File
RelativePath="..\..\src\bd_pr_search.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\bd_search.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\bd_tree.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\brute.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\kd_dump.cpp">
</File>
<File
RelativePath="..\..\src\kd_fix_rad_search.cpp">
</File>
<File
RelativePath="..\..\src\kd_pr_search.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\kd_search.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\kd_split.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\kd_tree.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\kd_util.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\perf.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\include\Ann\ANN.h">
</File>
<File
RelativePath="..\..\include\Ann\ANNperf.h">
</File>
<File
RelativePath="..\..\include\Ann\ANNx.h">
</File>
<File
RelativePath="..\..\src\bd_tree.h">
</File>
<File
RelativePath="..\..\src\kd_fix_rad_search.h">
</File>
<File
RelativePath="..\..\src\kd_pr_search.h">
</File>
<File
RelativePath="..\..\src\kd_search.h">
</File>
<File
RelativePath="..\..\src\kd_split.h">
</File>
<File
RelativePath="..\..\src\kd_tree.h">
</File>
<File
RelativePath="..\..\src\kd_util.h">
</File>
<File
RelativePath="..\..\src\pr_queue.h">
</File>
<File
RelativePath="..\..\src\pr_queue_k.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
-194
View File
@@ -1,194 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="sample"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ANN_NO_RANDOM;ANN_PERF"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/sample.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
OutputFile="..\bin\ann_sample.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/sample.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/sample.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ANN_NO_RANDOM"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/sample.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
OutputFile="..\bin\ann_sample.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/sample.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/sample.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\..\sample\ann_sample.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
</Filter>
<Filter
Name="Test Data"
Filter="">
<File
RelativePath="data_pts">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCustomBuildTool"/>
</FileConfiguration>
</File>
<File
RelativePath="query_pts">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCustomBuildTool"/>
</FileConfiguration>
</File>
<File
RelativePath="sample.out">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCustomBuildTool"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
-220
View File
@@ -1,220 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="test"
SccProjectName=""
SccLocalPath=""
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="NDEBUG;PREP;WIN32;_CONSOLE;ANN_NO_RANDOM"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/test.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
OutputFile="..\bin\ann_test.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/test.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/test.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;ANN_NO_RANDOM;ANN_PERF"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/test.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
OutputFile="..\bin\ann_test.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/test.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/test.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3081"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\..\test\ann_test.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\test\rand.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\test\rand.h">
</File>
</Filter>
<Filter
Name="Test Data"
Filter="">
<File
RelativePath="test1.data">
</File>
<File
RelativePath="test1.in">
</File>
<File
RelativePath="test1.query">
</File>
<File
RelativePath="test2.in">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
-194
View File
@@ -1,194 +0,0 @@
#-----------------------------------------------------------------------
# Makefile variations depending on different configurations
#
# ANN: Approximate Nearest Neighbors
# Version: 1.1 05/03/05
#
# (This Make-config structure is based on the one used by Mesa by Brian
# Paul. If you succeed in porting ANN to your favorite system, please
# send email to mount@cs.umd.edu, and I'll try to include it in this
# list.)
#
#----------------------------------------------------------------------
# The following configuration-dependent variables are passed to each
# the Makefile in subdirectories:
#
# ANNLIB The name of the ANN library file (usually libANN.a)
# C++ The C compiler (usually CC or g++)
# MAKELIB The command and flags to make a library file (usually
# "ar ...")
# CFLAGS Flags to C++ compiler
# RANLIB For "ranlib" = use ranlib, "true" = don't use ranlib
#----------------------------------------------------------------------
# Revision 0.1 09/06/97
# Initial release
# Revision 0.2 06/24/98
# Minor changes to fix compilation errors on SGI systems.
# Revision 1.0 04/01/05
# Modifications for alpha with cxx
# Removed CFLAGS2 options (just write your own)
# Removed -DUSING... (Compilers are pretty consistent these days)
# Added linux-g++ target
# Revision 1.1 05/03/05
# Added macosx-g++ target
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Compilation options (add these, as desired, to the CFLAGS variable
# in the desired compilation target below). For example,
#
# "CFLAGS = -O3 -Wall -DANN_PERF"
#
# -g Debugging.
# -O? Run-time optimization.
# -Wall Be verbose about warnings.
#
# -DANN_PERF Enable performance evaluation. (This may slow execution
# slightly.)
#
# -DANN_NO_LIMITS_H
# Use this if limits.h or float.h does not exist on your
# system. (Also see include/ANN/ANN.h for other changes
# needed.)
#
# -DANN_NO_RANDOM
# Use this option if srandom()/random() are not available
# on your system. Pseudo-random number generation is used
# in the utility program test/ann_test. The combination
# srandom()/random() is considered the best pseudo-random
# number generator, but is not available on all systems.
# If they are not available on your system (for example,
# Visual C++) then srand()/rand() will be used instead by
# setting this parameter.
#
# -DWIN32
# This is used only for compilation under windows systems
# (but instead of using this, use the various .vcproj
# files in the MS_WIN32 directory).
#-----------------------------------------------------------------------------
# Linux using g++
linux-g++:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3" \
"MAKELIB = ar ruv" \
"RANLIB = true"
# Mac OS X using g++
macosx-g++:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3" \
"MAKELIB = libtool -static -o " \
"RANLIB = true"
# SunOS5
sunos5:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = CC" \
"CFLAGS = -O" \
"MAKELIB = ar ruv" \
"RANLIB = true"
# SunOS5 with shared libraries
sunos5-sl:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = CC" \
"CFLAGS = -Kpic -O" \
"MAKELIB = ld -G -o" \
"RANLIB = true"
# SunOS5 with g++
sunos5-g++:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3" \
"MAKELIB = ar ruv" \
"RANLIB = true"
# SunOS5 with g++ and shared libraries
sunos5-g++-sl:
$(MAKE) targets \
"ANNLIB = libANN.so" \
"C++ = g++" \
"CFLAGS = -fpic -O3" \
"MAKELIB = ld -G -o" \
"RANLIB = true"
#-----------------------------------------------------------------------
# Used for the author's testing and debugging only
#-----------------------------------------------------------------------
# debugging version for authors
authors-debug:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -g -DANN_PERF -Wall" \
"MAKELIB = ar ruv" \
"RANLIB = true"
# performance testing version for authors
authors-perf:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3 -DANN_PERF -Wall" \
"MAKELIB = ar ruv" \
"RANLIB = true"
#-----------------------------------------------------------------------
# Some older ones that I have not tested with the latest version.
#-----------------------------------------------------------------------
sgi:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = CC -ansi" \
"CFLAGS = -O2" \
"MAKELIB = ar ruv" \
"RANLIB = true"
# DEC Alpha with g++
alpha-g++:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3" \
"MAKELIB = ar ruv" \
"RANLIB = ranlib"
# SunOS4
sunos4:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = CC" \
"CFLAGS = -O" \
"MAKELIB = ar ruv" \
"RANLIB = ranlib"
# SunOS4 with g++
sunos4-g++:
$(MAKE) targets \
"ANNLIB = libANN.a" \
"C++ = g++" \
"CFLAGS = -O3" \
"MAKELIB = ar ruv" \
"RANLIB = ranlib"
# SunOS4 with g++ and shared libraries
sunos4-g++-sl:
$(MAKE) targets \
"ANNLIB = libANN.so" \
"C++ = g++" \
"CC = g++" \
"CFLAGS = -fPIC -O3" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true"
-68
View File
@@ -1,68 +0,0 @@
ANN: Approximate Nearest Neighbors
Version: 1.1.1
Release date: Aug 4, 2006
----------------------------------------------------------------------------
Copyright (c) 1997-2005 University of Maryland and Sunil Arya and David
Mount. All Rights Reserved. See Copyright.txt and License.txt for
complete information on terms and conditions of use and distribution of
this software.
----------------------------------------------------------------------------
Authors
-------
David Mount
Dept of Computer Science
University of Maryland,
College Park, MD 20742 USA
mount@cs.umd.edu
http://www.cs.umd.edu/~mount/
Sunil Arya
Dept of Computer Science
Hong University of Science and Technology
Clearwater Bay, HONG KONG
arya@cs.ust.hk
http://www.cs.ust.hk/faculty/arya/
Introduction
------------
ANN is a library written in the C++ programming language to support both
exact and approximate nearest neighbor searching in spaces of various
dimensions. It was implemented by David M. Mount of the University of
Maryland, and Sunil Arya of the Hong Kong University of Science and
Technology. ANN (pronounced like the name ``Ann'') stands for
Approximate Nearest Neighbors. ANN is also a testbed containing
programs and procedures for generating data sets, collecting and
analyzing statistics on the performance of nearest neighbor algorithms
and data structures, and visualizing the geometric structure of these
data structures.
The ANN source code and documentation is available from the following
web page:
http://www.cs.umd.edu/~mount/ANN
For more information on ANN and its use, see the ``ANN Programming
Manual,'' which is provided with the software distribution.
----------------------------------------------------------------------------
History
Version 0.1 03/04/98
Preliminary release
Version 0.2 06/24/98
Changes for SGI compiler.
Version 1.0 04/01/05
Fixed a number of small bugs
Added dump/load operations
Added annClose to eliminate minor memory leak
Improved compatibility with current C++ compilers
Added compilation for Microsoft Visual Studio.NET
Added compilation for Linux 2.x
Version 1.1 05/03/05
Added make target for Mac OS X
Added fixed-radius range searching and counting
Added instructions on compiling/using ANN on Windows platforms
Fixed minor output bug in ann2fig
Version 1.1.1 08/04/06
Added "planted" distribution
Updated old source comments for GNU LPL.
-87
View File
@@ -1,87 +0,0 @@
#-----------------------------------------------------------------------------
# Makefile for ann2fig
#
# ANN: Approximate Nearest Neighbors
# Version: 1.1.1 08/04/06
#-----------------------------------------------------------------------------
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
# David Mount. All Rights Reserved.
#
# This software and related documentation is part of the Approximate
# Nearest Neighbor Library (ANN). This software is provided under
# the provisions of the Lesser GNU Public License (LGPL). See the
# file ../ReadMe.txt for further information.
#
# The University of Maryland (U.M.) and the authors make no
# representations about the suitability or fitness of this software for
# any purpose. It is provided "as is" without express or implied
# warranty.
#-----------------------------------------------------------------------------
# Revision 0.1 03/04/98
# Initial release
# Revision 1.1.1 08/04/06
# Added copyright/license
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Basic definitions
# BASEDIR where include, src, lib, ... are
# INCDIR include directory
# LIBDIR library directory
# BINDIR bin directory
# LDFLAGS loader flags
# ANNLIB ANN library
# OTHERLIB other libraries
#-----------------------------------------------------------------------------
BASEDIR = ..
INCDIR = $(BASEDIR)/include
LIBDIR = $(BASEDIR)/lib
BINDIR = $(BASEDIR)/bin
LDFLAGS = -L$(LIBDIR)
ANNLIBS = -lANN
OTHERLIBS = -lm
#-----------------------------------------------------------------------------
# Some more definitions
# ANN2FIG name of executable
#-----------------------------------------------------------------------------
ANN2FIG = ann2fig
SOURCES = ann2fig.cpp
OBJECTS = $(SOURCES:.cpp=.o)
#-----------------------------------------------------------------------------
# Make the program
#-----------------------------------------------------------------------------
default:
@echo "Specify a target configuration"
targets: $(BINDIR)/$(ANN2FIG)
$(BINDIR)/$(ANN2FIG): $(OBJECTS)
$(C++) $(OBJECTS) -o $(ANN2FIG) $(LDFLAGS) $(ANNLIBS) $(OTHERLIBS)
mv $(ANN2FIG) $(BINDIR)
#-----------------------------------------------------------------------------
# configuration definitions
#-----------------------------------------------------------------------------
include ../Make-config
#-----------------------------------------------------------------------------
# Objects
#-----------------------------------------------------------------------------
ann2fig.o: ann2fig.cpp
$(C++) -c -I$(INCDIR) ann2fig.cpp
#-----------------------------------------------------------------------------
# Cleaning
#-----------------------------------------------------------------------------
clean:
-rm -f *.o core
realclean: clean
-586
View File
@@ -1,586 +0,0 @@
//----------------------------------------------------------------------
// File: ann2fig.cpp
// Programmer: David Mount
// Last modified: 05/03/05
// Description: convert ann dump file to fig file
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Changed dump file suffix from .ann to .dmp.
// Revision 1.1 05/03/05
// Fixed usage output string.
//----------------------------------------------------------------------
// This program inputs an ann dump file of a search structure
// perhaps along with point coordinates, and outputs a fig (Ver 3.1)
// file (see fig2dev (1)) displaying the tree. The fig file may
// then be displayed using xfig, or converted to any of a number of
// other formats using fig2dev.
//
// If the dimension is 2 then the entire tree is display. If the
// dimension is larger than 2 then the user has the option of
// selecting which two dimensions will be displayed, and the slice
// value for each of the remaining dimensions. All leaf cells
// intersecting the slice are shown along with the points in these
// cells. See the procedure getArgs() below for the command-line
// arguments.
//----------------------------------------------------------------------
#include <cstdio> // C standard I/O
#include <fstream> // file I/O
#include <string> // string manipulation
#include <ANN/ANNx.h> // all ANN includes
using namespace std; // make std:: accessible
//----------------------------------------------------------------------
// Globals and their defaults
//----------------------------------------------------------------------
const int STRING_LEN = 500; // string lengths
const int MAX_DIM = 1000; // maximum dimension
const double DEF_SLICE_VAL = 0; // default slice value
const char FIG_HEAD[] = {"#FIG 3.1"}; // fig file header
const char DUMP_SUFFIX[] = {".dmp"}; // suffix for dump file
const char FIG_SUFFIX[] = {".fig"}; // suffix for fig file
char file_name[STRING_LEN]; // (root) file name (say xxx)
char infile_name[STRING_LEN];// input file name (xxx.dmp)
char outfile_name[STRING_LEN];// output file name (xxx.fig)
char caption[STRING_LEN]; // caption line (= command line)
ofstream ofile; // output file stream
ifstream ifile; // input file stream
int dim_x = 0; // horizontal dimension
int dim_y = 1; // vertical dimension
double slice_val[MAX_DIM]; // array of slice values
double u_per_in = 1200; // fig units per inch (version 3.1)
double in_size = 5; // size of figure (in inches)
double in_low_x = 1; // fig upper left corner (in inches)
double in_low_y = 1; // fig upper left corner (in inches)
double u_size = 6000; // size of figure (in units)
double u_low_x = 1200; // fig upper left corner (in units)
double u_low_y = 1200; // fig upper left corner (in units)
int pt_size = 10; // point size (in fig units)
int dim; // dimension
int n_pts; // number of points
ANNpointArray pts = NULL; // point array
double scale; // scale factor for transformation
double offset_x; // offsets for transformation
double offset_y;
// transformations
#define TRANS_X(p) (offset_x + scale*(p[dim_x]))
#define TRANS_Y(p) (offset_y - scale*(p[dim_y]))
//----------------------------------------------------------------------
// Error handler
//----------------------------------------------------------------------
void Error(char *msg, ANNerr level)
{
if (level == ANNabort) {
cerr << "ann2fig: ERROR------->" << msg << "<-------------ERROR\n";
exit(1);
}
else {
cerr << "ann2fig: WARNING----->" << msg << "<-------------WARNING\n";
}
}
//----------------------------------------------------------------------
// set_slice_val - set all slice values to given value
//----------------------------------------------------------------------
void set_slice_val(double val)
{
for (int i = 0; i < MAX_DIM; i++) {
slice_val[i] = val;
}
}
//----------------------------------------------------------------------
// getArgs - get input arguments
//
// Syntax:
// ann2fig [-upi scale] [-x low_x] [-y low_y]
// [-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]*
// [-ps pointsize]
// file
//
// where:
// -upi scale fig units per inch (default = 1200)
// -x low_x x and y offset of upper left corner (inches)
// -y low_y ...(default = 1)
// -sz size maximum side length of figure (in inches)
// ...(default = 5)
// -dx dim_x horizontal dimension (default = 0)
// -dy dim_y vertical dimension (default = 1)
// -sv value default slice value (default = 0)
// -sl dim value each such pair defines the value along the
// ...given dimension at which to slice. This
// ...may be supplied for all dimensions except
// ...dim_x and dim_y.
// -ps pointsize size of points in fig units (def = 10)
// file file (input=file.dmp, output=file.fig)
//
//----------------------------------------------------------------------
void getArgs(int argc, char **argv)
{
int i;
int sl_dim; // temp slice dimension
double sl_val; // temp slice value
set_slice_val(DEF_SLICE_VAL); // set initial slice-values
if (argc <= 1) {
cerr << "Syntax:\n\
ann2fig [-upi scale] [-x low_x] [-y low_y]\n\
[-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]*\n\
file\n\
\n\
where:\n\
-upi scale fig units per inch (default = 1200)\n\
-x low_x x and y offset of upper left corner (inches)\n\
-y low_y ...(default = 1)\n\
-sz size maximum side length of figure (in inches)\n\
...(default = 5)\n\
-dx dim_x horizontal dimension (default = 0)\n\
-dy dim_y vertical dimension (default = 1)\n\
-sv value default slice value (default = 0)\n\
-sl dim value each such pair defines the value along the\n\
...given dimension at which to slice. This\n\
...may be supplied for each dimension except\n\
...dim_x and dim_y.\n\
-ps pointsize size of points in fig units (def = 10)\n\
file file (input=file.dmp, output=file.fig)\n";
exit(0);
}
ANNbool fileSeen = ANNfalse; // file argument seen?
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-upi")) { // process -upi option
sscanf(argv[++i], "%lf", &u_per_in);
}
else if (!strcmp(argv[i], "-x")) { // process -x option
sscanf(argv[++i], "%lf", &in_low_x);
}
else if (!strcmp(argv[i], "-y")) { // process -y option
sscanf(argv[++i], "%lf", &in_low_y);
}
else if (!strcmp(argv[i], "-sz")) { // process -sz option
sscanf(argv[++i], "%lf", &in_size);
}
else if (!strcmp(argv[i], "-dx")) { // process -dx option
sscanf(argv[++i], "%d", &dim_x);
}
else if (!strcmp(argv[i], "-dy")) { // process -dy option
sscanf(argv[++i], "%d", &dim_y);
}
else if (!strcmp(argv[i], "-sv")) { // process -sv option
sscanf(argv[++i], "%lf", &sl_val);
set_slice_val(sl_val); // set slice values
}
else if (!strcmp(argv[i], "-sl")) { // process -sl option
sscanf(argv[++i], "%d", &sl_dim);
if (sl_dim < 0 || sl_dim >= MAX_DIM) {
Error("Slice dimension out of bounds", ANNabort);
}
sscanf(argv[++i], "%lf", &slice_val[sl_dim]);
}
if (!strcmp(argv[i], "-ps")) { // process -ps option
sscanf(argv[++i], "%i", &pt_size);
}
else { // must be file name
fileSeen = ANNtrue;
sscanf(argv[i], "%s", file_name);
strcpy(infile_name, file_name); // copy to input file name
strcat(infile_name, DUMP_SUFFIX);
strcpy(outfile_name, file_name); // copy to output file name
strcat(outfile_name, FIG_SUFFIX);
}
}
if (!fileSeen) { // no file seen
Error("File argument is required", ANNabort);
}
ifile.open(infile_name, ios::in); // open for reading
if (!ifile) {
Error("Cannot open input file", ANNabort);
}
ofile.open(outfile_name, ios::out); // open for writing
if (!ofile) {
Error("Cannot open output file", ANNabort);
}
u_low_x = u_per_in * in_low_x; // convert inches to fig units
u_low_y = u_per_in * in_low_y;
u_size = u_per_in * in_size;
strcpy(caption, argv[0]); // copy command line to caption
for (i = 1; i < argc; i++) {
strcat(caption, " ");
strcat(caption, argv[i]);
}
}
//----------------------------------------------------------------------
// Graphics utilities for fig output
//
// writeHeader write header for fig file
// writePoint write a point
// writeBox write a box
// writeLine write a line
//----------------------------------------------------------------------
void writeHeader()
{
ofile << FIG_HEAD << "\n" // fig file header
<< "Portrait\n"
<< "Center\n"
<< "Inches\n"
<< (int) u_per_in << " 2\n";
}
void writePoint(ANNpoint p) // write a single point
{
// filled black point object
ofile << "1 3 0 1 -1 7 0 0 0 0.000 1 0.0000 ";
int cent_x = (int) TRANS_X(p); // transform center coords
int cent_y = (int) TRANS_Y(p);
ofile << cent_x << " " << cent_y << " " // write center, radius, bounds
<< pt_size << " " << pt_size << " "
<< cent_x << " " << cent_y << " "
<< cent_x + pt_size << " " << cent_y + pt_size << "\n";
}
void writeBox(const ANNorthRect &r) // write box
{
// unfilled box object
ofile << "2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5\n";
int p0_x = (int) TRANS_X(r.lo); // transform endpoints
int p0_y = (int) TRANS_Y(r.lo);
int p1_x = (int) TRANS_X(r.hi);
int p1_y = (int) TRANS_Y(r.hi);
ofile << "\t"
<< p0_x << " " << p0_y << " " // write vertices
<< p1_x << " " << p0_y << " "
<< p1_x << " " << p1_y << " "
<< p0_x << " " << p1_y << " "
<< p0_x << " " << p0_y << "\n";
}
void writeLine(ANNpoint p0, ANNpoint p1) // write line
{
// unfilled line object
ofile << "2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2\n";
int p0_x = (int) TRANS_X(p0); // transform endpoints
int p0_y = (int) TRANS_Y(p0);
int p1_x = (int) TRANS_X(p1);
int p1_y = (int) TRANS_Y(p1);
ofile << "\t"
<< p0_x << " " << p0_y << " " // write vertices
<< p1_x << " " << p1_y << "\n";
}
void writeCaption( // write caption text
const ANNorthRect &bnd_box, // bounding box
char *caption) // caption
{
if (!strcmp(caption, "\0")) return; // null string?
int px = (int) TRANS_X(bnd_box.lo); // put .5 in. lower left
int py = (int) (TRANS_Y(bnd_box.lo) + 0.50 * u_per_in);
ofile << "4 0 -1 0 0 0 20 0.0000 4 255 2000 ";
ofile << px << " " << py << " " << caption << "\\001\n";
}
//----------------------------------------------------------------------
// overlap - test whether a box overlap slicing region
//
// The slicing region is a 2-dimensional plane in space
// which contains points (x1, x2, ..., xn) satisfying the
// n-2 linear equalities:
//
// xi == slice_val[i] for i != dim_x, dim_y
//
// This procedure returns true of the box defined by
// corner points box.lo and box.hi overlap this plane.
//----------------------------------------------------------------------
ANNbool overlap(const ANNorthRect &box)
{
for (int i = 0; i < dim; i++) {
if (i != dim_x && i != dim_y &&
(box.lo[i] > slice_val[i] || box.hi[i] < slice_val[i]))
return ANNfalse;
}
return ANNtrue;
}
//----------------------------------------------------------------------
// readTree, recReadTree - inputs tree and outputs figure
//
// readTree procedure initializes things and then calls recReadTree
// which does all the work.
//
// recReadTree reads in a node of the tree, makes any recursive
// calls as needed to input the children of this node (if internal)
// and maintains the bounding box. Note that the bounding box
// is modified within this procedure, but it is the responsibility
// of the procedure that it be restored to its original value
// on return.
//
// Recall that these are the formats. The tree is given in
// preorder.
//
// Leaf node:
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
// Splitting nodes:
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
// Shrinking nodes:
// shrink <n_bnds>
// <cut_dim> <cut_val> <side>
// <cut_dim> <cut_val> <side>
// ... (repeated n_bnds times)
//
// On reading a leaf we determine whether we should output the
// cell's points (if dimension = 2 or this cell overlaps the
// slicing region). For splitting nodes we check whether the
// current cell overlaps the slicing plane and whether the
// cutting dimension coincides with either the x or y drawing
// dimensions. If so, we output the corresponding splitting
// segment.
//----------------------------------------------------------------------
void recReadTree(ANNorthRect &box)
{
char tag[STRING_LEN]; // tag (leaf, split, shrink)
int n_pts; // number of points in leaf
int idx; // point index
int cd; // cut dimension
ANNcoord cv; // cut value
ANNcoord lb; // low bound
ANNcoord hb; // high bound
int n_bnds; // number of bounding sides
int sd; // which side
ifile >> tag; // input node tag
if (strcmp(tag, "leaf") == 0) { // leaf node
ifile >> n_pts; // input number of points
// check for overlap
if (dim == 2 || overlap(box)) {
for (int i = 0; i < n_pts; i++) { // yes, write the points
ifile >> idx;
writePoint(pts[idx]);
}
}
else { // input but ignore points
for (int i = 0; i < n_pts; i++) {
ifile >> idx;
}
}
}
else if (strcmp(tag, "split") == 0) { // splitting node
ifile >> cd >> cv >> lb >> hb;
if (lb != box.lo[cd] || hb != box.hi[cd]) {
Error("Bounding box coordinates are fishy", ANNwarn);
}
ANNcoord lv = box.lo[cd]; // save bounds for cutting dim
ANNcoord hv = box.hi[cd];
//--------------------------------------------------------------
// The following code is rather fragile so modify at your
// own risk. We first decrease the high-end of the bounding
// box down to the cutting plane and then read the left subtree.
// Then we increase the low-end of the bounding box up to the
// cutting plane (thus collapsing the bounding box to a d-1
// dimensional hyperrectangle). Then we draw the projection of
// its diagonal if it crosses the slicing plane. This will have
// the effect of drawing its intersection on the slicing plane.
// Then we restore the high-end of the bounding box and read
// the right subtree. Finally we restore the low-end of the
// bounding box, before returning.
//--------------------------------------------------------------
box.hi[cd] = cv; // decrease high bounds
recReadTree(box); // read left subtree
// check for overlap
box.lo[cd] = cv; // increase low bounds
if (dim == 2 || overlap(box)) { // check for overlap
if (cd == dim_x || cd == dim_y) { // cut through slice plane
writeLine(box.lo, box.hi); // draw cutting line
}
}
box.hi[cd] = hv; // restore high bounds
recReadTree(box); // read right subtree
box.lo[cd] = lv; // restore low bounds
}
else if (strcmp(tag, "shrink") == 0) { // splitting node
ANNorthRect inner(dim, box); // copy bounding box
ifile >> n_bnds; // number of bounding sides
for (int i = 0; i < n_bnds; i++) {
ifile >> cd >> cv >> sd; // input bounding halfspace
ANNorthHalfSpace hs(cd, cv, sd); // create orthogonal halfspace
hs.project(inner.lo); // intersect by projecting
hs.project(inner.hi);
}
if (dim == 2 || overlap(inner)) {
writeBox(inner); // draw inner rectangle
}
recReadTree(inner); // read inner subtree
recReadTree(box); // read outer subtree
}
else {
Error("Illegal node type in dump file", ANNabort);
}
}
void readTree(ANNorthRect &bnd_box)
{
writeHeader(); // output header
writeBox(bnd_box); // draw bounding box
writeCaption(bnd_box, caption); // write caption
recReadTree(bnd_box); // do it
}
//----------------------------------------------------------------------
// readANN - read the ANN dump file
//
// This procedure reads in the dump file. See the format below.
// It first reads the header line with version number. If the
// points section is present it reads them (otherwise just leaves
// points = NULL), and then it reads the tree section. It inputs
// the bounding box and determines the parameters for transforming
// the image to figure units. It then invokes the procedure
// readTree to do all the real work.
//
// Dump File Format: <xxx> = coordinate value (ANNcoord)
//
// #ANN <version number> <comments> [END_OF_LINE]
// points <dim> <n_pts> (point coordinates: this is optional)
// 0 <xxx> <xxx> ... <xxx> (point indices and coordinates)
// 1 <xxx> <xxx> ... <xxx>
// ...
// tree <dim> <n_pts> <bkt_size>
// <xxx> <xxx> ... <xxx> (lower end of bounding box)
// <xxx> <xxx> ... <xxx> (upper end of bounding box)
// If the tree is null, then a single line "null" is
// output. Otherwise the nodes of the tree are printed
// one per line in preorder. Leaves and splitting nodes
// have the following formats:
// Leaf node:
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
// Splitting nodes:
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
// Shrinking nodes:
// shrink <n_bnds>
// <cut_dim> <cut_val> <side>
// <cut_dim> <cut_val> <side>
// ... (repeated n_bnds times)
//
// Note: Infinite lo_ and hi_bounds are printed as the special
// values "-INF" and "+INF", respectively. We do not
// check for this, because the current version of ANN
// starts with a finite bounding box if the tree is
// nonempty.
//----------------------------------------------------------------------
void readANN()
{
int j;
char str[STRING_LEN]; // storage for string
char version[STRING_LEN]; // storage for version
int bkt_size; // bucket size
ifile >> str; // input header
if (strcmp(str, "#ANN") != 0) { // incorrect header
Error("Incorrect header for dump file", ANNabort);
}
ifile.getline(version, STRING_LEN); // get version (ignore)
ifile >> str; // get major heading
if (strcmp(str, "points") == 0) { // points section
ifile >> dim; // read dimension
ifile >> n_pts; // number of points
pts = annAllocPts(n_pts, dim); // allocate points
for (int i = 0; i < n_pts; i++) { // input point coordinates
int idx; // point index
ifile >> idx; // input point index
if (idx < 0 || idx >= n_pts) {
Error("Point index is out of range", ANNabort);
}
for (j = 0; j < dim; j++) {
ifile >> pts[idx][j]; // read point coordinates
}
}
ifile >> str; // get next major heading
}
if (strcmp(str, "tree") == 0) { // tree section
ifile >> dim; // read dimension
if (dim_x > dim || dim_y > dim) {
Error("Dimensions out of bounds", ANNabort);
}
ifile >> n_pts; // number of points
ifile >> bkt_size; // bucket size (ignored)
// read bounding box
ANNorthRect bnd_box(dim); // create bounding box
for (j = 0; j < dim; j++) {
ifile >> bnd_box.lo[j]; // read box low coordinates
}
for (j = 0; j < dim; j++) {
ifile >> bnd_box.hi[j]; // read box high coordinates
}
// compute scaling factors
double box_len_x = bnd_box.hi[dim_x] - bnd_box.lo[dim_x];
double box_len_y = bnd_box.hi[dim_y] - bnd_box.lo[dim_y];
// longer side determines scale
if (box_len_x > box_len_y) scale = u_size/box_len_x;
else scale = u_size/box_len_y;
// compute offsets
offset_x = u_low_x - scale*bnd_box.lo[dim_x];
offset_y = u_low_y + scale*bnd_box.hi[dim_y];
readTree(bnd_box); // read the tree and process
}
else if (strcmp(str, "null") == 0) return; // empty tree
else {
cerr << "Input string: " << str << "\n";
Error("Illegal ann format. Expecting section heading", ANNabort);
}
}
//----------------------------------------------------------------------
// Main program
//
// Gets the command-line arguments and invokes the main scanning
// procedure.
//----------------------------------------------------------------------
int main(int argc, char **argv)
{
getArgs(argc, argv); // get input arguments
readANN(); // read the dump file
return 0;
}
Binary file not shown.
-826
View File
@@ -1,826 +0,0 @@
//----------------------------------------------------------------------
// File: ANN.h
// Programmer: Sunil Arya and David Mount
// Last modified: 05/03/05 (Release 1.1)
// Description: Basic include file for approximate nearest
// neighbor searching.
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Added copyright and revision information
// Added ANNcoordPrec for coordinate precision.
// Added methods theDim, nPoints, maxPoints, thePoints to ANNpointSet.
// Cleaned up C++ structure for modern compilers
// Revision 1.1 05/03/05
// Added fixed-radius k-NN searching
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// ANN - approximate nearest neighbor searching
// ANN is a library for approximate nearest neighbor searching,
// based on the use of standard and priority search in kd-trees
// and balanced box-decomposition (bbd) trees. Here are some
// references to the main algorithmic techniques used here:
//
// kd-trees:
// Friedman, Bentley, and Finkel, ``An algorithm for finding
// best matches in logarithmic expected time,'' ACM
// Transactions on Mathematical Software, 3(3):209-226, 1977.
//
// Priority search in kd-trees:
// Arya and Mount, ``Algorithms for fast vector quantization,''
// Proc. of DCC '93: Data Compression Conference, eds. J. A.
// Storer and M. Cohn, IEEE Press, 1993, 381-390.
//
// Approximate nearest neighbor search and bbd-trees:
// Arya, Mount, Netanyahu, Silverman, and Wu, ``An optimal
// algorithm for approximate nearest neighbor searching,''
// 5th Ann. ACM-SIAM Symposium on Discrete Algorithms,
// 1994, 573-582.
//----------------------------------------------------------------------
#ifndef ANN_H
#define ANN_H
#ifdef WIN32
//----------------------------------------------------------------------
// For Microsoft Visual C++, externally accessible symbols must be
// explicitly indicated with DLL_API, which is somewhat like "extern."
//
// The following ifdef block is the standard way of creating macros
// which make exporting from a DLL simpler. All files within this DLL
// are compiled with the DLL_EXPORTS preprocessor symbol defined on the
// command line. In contrast, projects that use (or import) the DLL
// objects do not define the DLL_EXPORTS symbol. This way any other
// project whose source files include this file see DLL_API functions as
// being imported from a DLL, wheras this DLL sees symbols defined with
// this macro as being exported.
//----------------------------------------------------------------------
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
//----------------------------------------------------------------------
// DLL_API is ignored for all other systems
//----------------------------------------------------------------------
#else
#define DLL_API
#endif
//----------------------------------------------------------------------
// basic includes
//----------------------------------------------------------------------
#include <cmath> // math includes
#include <iostream> // I/O streams
//----------------------------------------------------------------------
// Limits
// There are a number of places where we use the maximum double value as
// default initializers (and others may be used, depending on the
// data/distance representation). These can usually be found in limits.h
// (as LONG_MAX, INT_MAX) or in float.h (as DBL_MAX, FLT_MAX).
//
// Not all systems have these files. If you are using such a system,
// you should set the preprocessor symbol ANN_NO_LIMITS_H when
// compiling, and modify the statements below to generate the
// appropriate value. For practical purposes, this does not need to be
// the maximum double value. It is sufficient that it be at least as
// large than the maximum squared distance between between any two
// points.
//----------------------------------------------------------------------
#ifdef ANN_NO_LIMITS_H // limits.h unavailable
#include <cvalues> // replacement for limits.h
const double ANN_DBL_MAX = MAXDOUBLE; // insert maximum double
#else
#include <climits>
#include <cfloat>
const double ANN_DBL_MAX = DBL_MAX;
#endif
#define ANNversion "1.1.1" // ANN version and information
#define ANNversionCmt ""
#define ANNcopyright "David M. Mount and Sunil Arya"
#define ANNlatestRev "Aug 4, 2006"
//----------------------------------------------------------------------
// ANNbool
// This is a simple boolean type. Although ANSI C++ is supposed
// to support the type bool, some compilers do not have it.
//----------------------------------------------------------------------
enum ANNbool {ANNfalse = 0, ANNtrue = 1}; // ANN boolean type (non ANSI C++)
//----------------------------------------------------------------------
// ANNcoord, ANNdist
// ANNcoord and ANNdist are the types used for representing
// point coordinates and distances. They can be modified by the
// user, with some care. It is assumed that they are both numeric
// types, and that ANNdist is generally of an equal or higher type
// from ANNcoord. A variable of type ANNdist should be large
// enough to store the sum of squared components of a variable
// of type ANNcoord for the number of dimensions needed in the
// application. For example, the following combinations are
// legal:
//
// ANNcoord ANNdist
// --------- -------------------------------
// short short, int, long, float, double
// int int, long, float, double
// long long, float, double
// float float, double
// double double
//
// It is the user's responsibility to make sure that overflow does
// not occur in distance calculation.
//----------------------------------------------------------------------
typedef double ANNcoord; // coordinate data type
typedef double ANNdist; // distance data type
//----------------------------------------------------------------------
// ANNidx
// ANNidx is a point index. When the data structure is built, the
// points are given as an array. Nearest neighbor results are
// returned as an integer index into this array. To make it
// clearer when this is happening, we define the integer type
// ANNidx. Indexing starts from 0.
//
// For fixed-radius near neighbor searching, it is possible that
// there are not k nearest neighbors within the search radius. To
// indicate this, the algorithm returns ANN_NULL_IDX as its result.
// It should be distinguishable from any valid array index.
//----------------------------------------------------------------------
typedef int ANNidx; // point index
const ANNidx ANN_NULL_IDX = -1; // a NULL point index
//----------------------------------------------------------------------
// Infinite distance:
// The code assumes that there is an "infinite distance" which it
// uses to initialize distances before performing nearest neighbor
// searches. It should be as larger or larger than any legitimate
// nearest neighbor distance.
//
// On most systems, these should be found in the standard include
// file <limits.h> or possibly <float.h>. If you do not have these
// file, some suggested values are listed below, assuming 64-bit
// long, 32-bit int and 16-bit short.
//
// ANNdist ANN_DIST_INF Values (see <limits.h> or <float.h>)
// ------- ------------ ------------------------------------
// double DBL_MAX 1.79769313486231570e+308
// float FLT_MAX 3.40282346638528860e+38
// long LONG_MAX 0x7fffffffffffffff
// int INT_MAX 0x7fffffff
// short SHRT_MAX 0x7fff
//----------------------------------------------------------------------
const ANNdist ANN_DIST_INF = ANN_DBL_MAX;
//----------------------------------------------------------------------
// Significant digits for tree dumps:
// When floating point coordinates are used, the routine that dumps
// a tree needs to know roughly how many significant digits there
// are in a ANNcoord, so it can output points to full precision.
// This is defined to be ANNcoordPrec. On most systems these
// values can be found in the standard include files <limits.h> or
// <float.h>. For integer types, the value is essentially ignored.
//
// ANNcoord ANNcoordPrec Values (see <limits.h> or <float.h>)
// -------- ------------ ------------------------------------
// double DBL_DIG 15
// float FLT_DIG 6
// long doesn't matter 19
// int doesn't matter 10
// short doesn't matter 5
//----------------------------------------------------------------------
#ifdef DBL_DIG // number of sig. bits in ANNcoord
const int ANNcoordPrec = DBL_DIG;
#else
const int ANNcoordPrec = 15; // default precision
#endif
//----------------------------------------------------------------------
// Self match?
// In some applications, the nearest neighbor of a point is not
// allowed to be the point itself. This occurs, for example, when
// computing all nearest neighbors in a set. By setting the
// parameter ANN_ALLOW_SELF_MATCH to ANNfalse, the nearest neighbor
// is the closest point whose distance from the query point is
// strictly positive.
//----------------------------------------------------------------------
const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue;
//----------------------------------------------------------------------
// Norms and metrics:
// ANN supports any Minkowski norm for defining distance. In
// particular, for any p >= 1, the L_p Minkowski norm defines the
// length of a d-vector (v0, v1, ..., v(d-1)) to be
//
// (|v0|^p + |v1|^p + ... + |v(d-1)|^p)^(1/p),
//
// (where ^ denotes exponentiation, and |.| denotes absolute
// value). The distance between two points is defined to be the
// norm of the vector joining them. Some common distance metrics
// include
//
// Euclidean metric p = 2
// Manhattan metric p = 1
// Max metric p = infinity
//
// In the case of the max metric, the norm is computed by taking
// the maxima of the absolute values of the components. ANN is
// highly "coordinate-based" and does not support general distances
// functions (e.g. those obeying just the triangle inequality). It
// also does not support distance functions based on
// inner-products.
//
// For the purpose of computing nearest neighbors, it is not
// necessary to compute the final power (1/p). Thus the only
// component that is used by the program is |v(i)|^p.
//
// ANN parameterizes the distance computation through the following
// macros. (Macros are used rather than procedures for
// efficiency.) Recall that the distance between two points is
// given by the length of the vector joining them, and the length
// or norm of a vector v is given by formula:
//
// |v| = ROOT(POW(v0) # POW(v1) # ... # POW(v(d-1)))
//
// where ROOT, POW are unary functions and # is an associative and
// commutative binary operator mapping the following types:
//
// ** POW: ANNcoord --> ANNdist
// ** #: ANNdist x ANNdist --> ANNdist
// ** ROOT: ANNdist (>0) --> double
//
// For early termination in distance calculation (partial distance
// calculation) we assume that POW and # together are monotonically
// increasing on sequences of arguments, meaning that for all
// v0..vk and y:
//
// POW(v0) #...# POW(vk) <= (POW(v0) #...# POW(vk)) # POW(y).
//
// Incremental Distance Calculation:
// The program uses an optimized method of computing distances for
// kd-trees and bd-trees, called incremental distance calculation.
// It is used when distances are to be updated when only a single
// coordinate of a point has been changed. In order to use this,
// we assume that there is an incremental update function DIFF(x,y)
// for #, such that if:
//
// s = x0 # ... # xi # ... # xk
//
// then if s' is equal to s but with xi replaced by y, that is,
//
// s' = x0 # ... # y # ... # xk
//
// then the length of s' can be computed by:
//
// |s'| = |s| # DIFF(xi,y).
//
// Thus, if # is + then DIFF(xi,y) is (yi-x). For the L_infinity
// norm we make use of the fact that in the program this function
// is only invoked when y > xi, and hence DIFF(xi,y)=y.
//
// Finally, for approximate nearest neighbor queries we assume
// that POW and ROOT are related such that
//
// v*ROOT(x) = ROOT(POW(v)*x)
//
// Here are the values for the various Minkowski norms:
//
// L_p: p even: p odd:
// ------------------------- ------------------------
// POW(v) = v^p POW(v) = |v|^p
// ROOT(x) = x^(1/p) ROOT(x) = x^(1/p)
// # = + # = +
// DIFF(x,y) = y - x DIFF(x,y) = y - x
//
// L_inf:
// POW(v) = |v|
// ROOT(x) = x
// # = max
// DIFF(x,y) = y
//
// By default the Euclidean norm is assumed. To change the norm,
// uncomment the appropriate set of macros below.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Use the following for the Euclidean norm
//----------------------------------------------------------------------
#define ANN_POW(v) ((v)*(v))
#define ANN_ROOT(x) sqrt(x)
#define ANN_SUM(x,y) ((x) + (y))
#define ANN_DIFF(x,y) ((y) - (x))
//----------------------------------------------------------------------
// Use the following for the L_1 (Manhattan) norm
//----------------------------------------------------------------------
// #define ANN_POW(v) fabs(v)
// #define ANN_ROOT(x) (x)
// #define ANN_SUM(x,y) ((x) + (y))
// #define ANN_DIFF(x,y) ((y) - (x))
//----------------------------------------------------------------------
// Use the following for a general L_p norm
//----------------------------------------------------------------------
// #define ANN_POW(v) pow(fabs(v),p)
// #define ANN_ROOT(x) pow(fabs(x),1/p)
// #define ANN_SUM(x,y) ((x) + (y))
// #define ANN_DIFF(x,y) ((y) - (x))
//----------------------------------------------------------------------
// Use the following for the L_infinity (Max) norm
//----------------------------------------------------------------------
// #define ANN_POW(v) fabs(v)
// #define ANN_ROOT(x) (x)
// #define ANN_SUM(x,y) ((x) > (y) ? (x) : (y))
// #define ANN_DIFF(x,y) (y)
//----------------------------------------------------------------------
// Array types
// The following array types are of basic interest. A point is
// just a dimensionless array of coordinates, a point array is a
// dimensionless array of points. A distance array is a
// dimensionless array of distances and an index array is a
// dimensionless array of point indices. The latter two are used
// when returning the results of k-nearest neighbor queries.
//----------------------------------------------------------------------
typedef ANNcoord* ANNpoint; // a point
typedef ANNpoint* ANNpointArray; // an array of points
typedef ANNdist* ANNdistArray; // an array of distances
typedef ANNidx* ANNidxArray; // an array of point indices
//----------------------------------------------------------------------
// Basic point and array utilities:
// The following procedures are useful supplements to ANN's nearest
// neighbor capabilities.
//
// annDist():
// Computes the (squared) distance between a pair of points.
// Note that this routine is not used internally by ANN for
// computing distance calculations. For reasons of efficiency
// this is done using incremental distance calculation. Thus,
// this routine cannot be modified as a method of changing the
// metric.
//
// Because points (somewhat like strings in C) are stored as
// pointers. Consequently, creating and destroying copies of
// points may require storage allocation. These procedures do
// this.
//
// annAllocPt() and annDeallocPt():
// Allocate a deallocate storage for a single point, and
// return a pointer to it. The argument to AllocPt() is
// used to initialize all components.
//
// annAllocPts() and annDeallocPts():
// Allocate and deallocate an array of points as well a
// place to store their coordinates, and initializes the
// points to point to their respective coordinates. It
// allocates point storage in a contiguous block large
// enough to store all the points. It performs no
// initialization.
//
// annCopyPt():
// Creates a copy of a given point, allocating space for
// the new point. It returns a pointer to the newly
// allocated copy.
//----------------------------------------------------------------------
DLL_API ANNdist annDist(
int dim, // dimension of space
ANNpoint p, // points
ANNpoint q);
DLL_API ANNpoint annAllocPt(
int dim, // dimension
ANNcoord c = 0); // coordinate value (all equal)
DLL_API ANNpointArray annAllocPts(
int n, // number of points
int dim); // dimension
DLL_API void annDeallocPt(
ANNpoint &p); // deallocate 1 point
DLL_API void annDeallocPts(
ANNpointArray &pa); // point array
DLL_API ANNpoint annCopyPt(
int dim, // dimension
ANNpoint source); // point to copy
//----------------------------------------------------------------------
//Overall structure: ANN supports a number of different data structures
//for approximate and exact nearest neighbor searching. These are:
//
// ANNbruteForce A simple brute-force search structure.
// ANNkd_tree A kd-tree tree search structure. ANNbd_tree
// A bd-tree tree search structure (a kd-tree with shrink
// capabilities).
//
// At a minimum, each of these data structures support k-nearest
// neighbor queries. The nearest neighbor query, annkSearch,
// returns an integer identifier and the distance to the nearest
// neighbor(s) and annRangeSearch returns the nearest points that
// lie within a given query ball.
//
// Each structure is built by invoking the appropriate constructor
// and passing it (at a minimum) the array of points, the total
// number of points and the dimension of the space. Each structure
// is also assumed to support a destructor and member functions
// that return basic information about the point set.
//
// Note that the array of points is not copied by the data
// structure (for reasons of space efficiency), and it is assumed
// to be constant throughout the lifetime of the search structure.
//
// The search algorithm, annkSearch, is given the query point (q),
// and the desired number of nearest neighbors to report (k), and
// the error bound (eps) (whose default value is 0, implying exact
// nearest neighbors). It returns two arrays which are assumed to
// contain at least k elements: one (nn_idx) contains the indices
// (within the point array) of the nearest neighbors and the other
// (dd) contains the squared distances to these nearest neighbors.
//
// The search algorithm, annkFRSearch, is a fixed-radius kNN
// search. In addition to a query point, it is given a (squared)
// radius bound. (This is done for consistency, because the search
// returns distances as squared quantities.) It does two things.
// First, it computes the k nearest neighbors within the radius
// bound, and second, it returns the total number of points lying
// within the radius bound. It is permitted to set k = 0, in which
// case it effectively answers a range counting query. If the
// error bound epsilon is positive, then the search is approximate
// in the sense that it is free to ignore any point that lies
// outside a ball of radius r/(1+epsilon), where r is the given
// (unsquared) radius bound.
//
// The generic object from which all the search structures are
// dervied is given below. It is a virtual object, and is useless
// by itself.
//----------------------------------------------------------------------
class DLL_API ANNpointSet {
public:
virtual ~ANNpointSet() {} // virtual distructor
virtual void annkSearch( // approx k near neighbor search
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor array (modified)
ANNdistArray dd, // dist to near neighbors (modified)
double eps=0.0 // error bound
) = 0; // pure virtual (defined elsewhere)
virtual int annkFRSearch( // approx fixed-radius kNN search
ANNpoint q, // query point
ANNdist sqRad, // squared radius
int k = 0, // number of near neighbors to return
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
ANNdistArray dd = NULL, // dist to near neighbors (modified)
double eps=0.0 // error bound
) = 0; // pure virtual (defined elsewhere)
virtual int theDim() = 0; // return dimension of space
virtual int nPoints() = 0; // return number of points
// return pointer to points
virtual ANNpointArray thePoints() = 0;
};
//----------------------------------------------------------------------
// Brute-force nearest neighbor search:
// The brute-force search structure is very simple but inefficient.
// It has been provided primarily for the sake of comparison with
// and validation of the more complex search structures.
//
// Query processing is the same as described above, but the value
// of epsilon is ignored, since all distance calculations are
// performed exactly.
//
// WARNING: This data structure is very slow, and should not be
// used unless the number of points is very small.
//
// Internal information:
// ---------------------
// This data structure bascially consists of the array of points
// (each a pointer to an array of coordinates). The search is
// performed by a simple linear scan of all the points.
//----------------------------------------------------------------------
class DLL_API ANNbruteForce: public ANNpointSet {
int dim; // dimension
int n_pts; // number of points
ANNpointArray pts; // point array
public:
ANNbruteForce( // constructor from point array
ANNpointArray pa, // point array
int n, // number of points
int dd); // dimension
~ANNbruteForce(); // destructor
void annkSearch( // approx k near neighbor search
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor array (modified)
ANNdistArray dd, // dist to near neighbors (modified)
double eps=0.0); // error bound
int annkFRSearch( // approx fixed-radius kNN search
ANNpoint q, // query point
ANNdist sqRad, // squared radius
int k = 0, // number of near neighbors to return
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
ANNdistArray dd = NULL, // dist to near neighbors (modified)
double eps=0.0); // error bound
int theDim() // return dimension of space
{ return dim; }
int nPoints() // return number of points
{ return n_pts; }
ANNpointArray thePoints() // return pointer to points
{ return pts; }
};
//----------------------------------------------------------------------
// kd- and bd-tree splitting and shrinking rules
// kd-trees supports a collection of different splitting rules.
// In addition to the standard kd-tree splitting rule proposed
// by Friedman, Bentley, and Finkel, we have introduced a
// number of other splitting rules, which seem to perform
// as well or better (for the distributions we have tested).
//
// The splitting methods given below allow the user to tailor
// the data structure to the particular data set. They are
// are described in greater details in the kd_split.cc source
// file. The method ANN_KD_SUGGEST is the method chosen (rather
// subjectively) by the implementors as the one giving the
// fastest performance, and is the default splitting method.
//
// As with splitting rules, there are a number of different
// shrinking rules. The shrinking rule ANN_BD_NONE does no
// shrinking (and hence produces a kd-tree tree). The rule
// ANN_BD_SUGGEST uses the implementors favorite rule.
//----------------------------------------------------------------------
enum ANNsplitRule {
ANN_KD_STD = 0, // the optimized kd-splitting rule
ANN_KD_MIDPT = 1, // midpoint split
ANN_KD_FAIR = 2, // fair split
ANN_KD_SL_MIDPT = 3, // sliding midpoint splitting method
ANN_KD_SL_FAIR = 4, // sliding fair split method
ANN_KD_SUGGEST = 5}; // the authors' suggestion for best
const int ANN_N_SPLIT_RULES = 6; // number of split rules
enum ANNshrinkRule {
ANN_BD_NONE = 0, // no shrinking at all (just kd-tree)
ANN_BD_SIMPLE = 1, // simple splitting
ANN_BD_CENTROID = 2, // centroid splitting
ANN_BD_SUGGEST = 3}; // the authors' suggested choice
const int ANN_N_SHRINK_RULES = 4; // number of shrink rules
//----------------------------------------------------------------------
// kd-tree:
// The main search data structure supported by ANN is a kd-tree.
// The main constructor is given a set of points and a choice of
// splitting method to use in building the tree.
//
// Construction:
// -------------
// The constructor is given the point array, number of points,
// dimension, bucket size (default = 1), and the splitting rule
// (default = ANN_KD_SUGGEST). The point array is not copied, and
// is assumed to be kept constant throughout the lifetime of the
// search structure. There is also a "load" constructor that
// builds a tree from a file description that was created by the
// Dump operation.
//
// Search:
// -------
// There are two search methods:
//
// Standard search (annkSearch()):
// Searches nodes in tree-traversal order, always visiting
// the closer child first.
// Priority search (annkPriSearch()):
// Searches nodes in order of increasing distance of the
// associated cell from the query point. For many
// distributions the standard search seems to work just
// fine, but priority search is safer for worst-case
// performance.
//
// Printing:
// ---------
// There are two methods provided for printing the tree. Print()
// is used to produce a "human-readable" display of the tree, with
// indenation, which is handy for debugging. Dump() produces a
// format that is suitable reading by another program. There is a
// "load" constructor, which constructs a tree which is assumed to
// have been saved by the Dump() procedure.
//
// Performance and Structure Statistics:
// -------------------------------------
// The procedure getStats() collects statistics information on the
// tree (its size, height, etc.) See ANNperf.h for information on
// the stats structure it returns.
//
// Internal information:
// ---------------------
// The data structure consists of three major chunks of storage.
// The first (implicit) storage are the points themselves (pts),
// which have been provided by the users as an argument to the
// constructor, or are allocated dynamically if the tree is built
// using the load constructor). These should not be changed during
// the lifetime of the search structure. It is the user's
// responsibility to delete these after the tree is destroyed.
//
// The second is the tree itself (which is dynamically allocated in
// the constructor) and is given as a pointer to its root node
// (root). These nodes are automatically deallocated when the tree
// is deleted. See the file src/kd_tree.h for further information
// on the structure of the tree nodes.
//
// Each leaf of the tree does not contain a pointer directly to a
// point, but rather contains a pointer to a "bucket", which is an
// array consisting of point indices. The third major chunk of
// storage is an array (pidx), which is a large array in which all
// these bucket subarrays reside. (The reason for storing them
// separately is the buckets are typically small, but of varying
// sizes. This was done to avoid fragmentation.) This array is
// also deallocated when the tree is deleted.
//
// In addition to this, the tree consists of a number of other
// pieces of information which are used in searching and for
// subsequent tree operations. These consist of the following:
//
// dim Dimension of space
// n_pts Number of points currently in the tree
// n_max Maximum number of points that are allowed
// in the tree
// bkt_size Maximum bucket size (no. of points per leaf)
// bnd_box_lo Bounding box low point
// bnd_box_hi Bounding box high point
// splitRule Splitting method used
//
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Some types and objects used by kd-tree functions
// See src/kd_tree.h and src/kd_tree.cpp for definitions
//----------------------------------------------------------------------
class ANNkdStats; // stats on kd-tree
class ANNkd_node; // generic node in a kd-tree
typedef ANNkd_node* ANNkd_ptr; // pointer to a kd-tree node
class DLL_API ANNkd_tree: public ANNpointSet {
protected:
int dim; // dimension of space
int n_pts; // number of points in tree
int bkt_size; // bucket size
ANNpointArray pts; // the points
ANNidxArray pidx; // point indices (to pts array)
ANNkd_ptr root; // root of kd-tree
ANNpoint bnd_box_lo; // bounding box low point
ANNpoint bnd_box_hi; // bounding box high point
void SkeletonTree( // construct skeleton tree
int n, // number of points
int dd, // dimension
int bs, // bucket size
ANNpointArray pa = NULL, // point array (optional)
ANNidxArray pi = NULL); // point indices (optional)
public:
ANNkd_tree( // build skeleton tree
int n = 0, // number of points
int dd = 0, // dimension
int bs = 1); // bucket size
ANNkd_tree( // build from point array
ANNpointArray pa, // point array
int n, // number of points
int dd, // dimension
int bs = 1, // bucket size
ANNsplitRule split = ANN_KD_SUGGEST); // splitting method
ANNkd_tree( // build from dump file
std::istream& in); // input stream for dump file
~ANNkd_tree(); // tree destructor
void annkSearch( // approx k near neighbor search
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor array (modified)
ANNdistArray dd, // dist to near neighbors (modified)
double eps=0.0); // error bound
void annkPriSearch( // priority k near neighbor search
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor array (modified)
ANNdistArray dd, // dist to near neighbors (modified)
double eps=0.0); // error bound
int annkFRSearch( // approx fixed-radius kNN search
ANNpoint q, // the query point
ANNdist sqRad, // squared radius of query ball
int k, // number of neighbors to return
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
ANNdistArray dd = NULL, // dist to near neighbors (modified)
double eps=0.0); // error bound
int theDim() // return dimension of space
{ return dim; }
int nPoints() // return number of points
{ return n_pts; }
ANNpointArray thePoints() // return pointer to points
{ return pts; }
virtual void Print( // print the tree (for debugging)
ANNbool with_pts, // print points as well?
std::ostream& out); // output stream
virtual void Dump( // dump entire tree
ANNbool with_pts, // print points as well?
std::ostream& out); // output stream
virtual void getStats( // compute tree statistics
ANNkdStats& st); // the statistics (modified)
};
//----------------------------------------------------------------------
// Box decomposition tree (bd-tree)
// The bd-tree is inherited from a kd-tree. The main difference
// in the bd-tree and the kd-tree is a new type of internal node
// called a shrinking node (in the kd-tree there is only one type
// of internal node, a splitting node). The shrinking node
// makes it possible to generate balanced trees in which the
// cells have bounded aspect ratio, by allowing the decomposition
// to zoom in on regions of dense point concentration. Although
// this is a nice idea in theory, few point distributions are so
// densely clustered that this is really needed.
//----------------------------------------------------------------------
class DLL_API ANNbd_tree: public ANNkd_tree {
public:
ANNbd_tree( // build skeleton tree
int n, // number of points
int dd, // dimension
int bs = 1) // bucket size
: ANNkd_tree(n, dd, bs) {} // build base kd-tree
ANNbd_tree( // build from point array
ANNpointArray pa, // point array
int n, // number of points
int dd, // dimension
int bs = 1, // bucket size
ANNsplitRule split = ANN_KD_SUGGEST, // splitting rule
ANNshrinkRule shrink = ANN_BD_SUGGEST); // shrinking rule
ANNbd_tree( // build from dump file
std::istream& in); // input stream for dump file
};
//----------------------------------------------------------------------
// Other functions
// annMaxPtsVisit Sets a limit on the maximum number of points
// to visit in the search.
// annClose Can be called when all use of ANN is finished.
// It clears up a minor memory leak.
//----------------------------------------------------------------------
DLL_API void annMaxPtsVisit( // max. pts to visit in search
int maxPts); // the limit
DLL_API void annClose(); // called to end use of ANN
#endif
-223
View File
@@ -1,223 +0,0 @@
//----------------------------------------------------------------------
// File: ANNperf.h
// Programmer: Sunil Arya and David Mount
// Last modified: 03/04/98 (Release 0.1)
// Description: Include file for ANN performance stats
//
// Some of the code for statistics gathering has been adapted
// from the SmplStat.h package in the g++ library.
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Added ANN_ prefix to avoid name conflicts.
//----------------------------------------------------------------------
#ifndef ANNperf_H
#define ANNperf_H
//----------------------------------------------------------------------
// basic includes
//----------------------------------------------------------------------
#include <ANN/ANN.h> // basic ANN includes
//----------------------------------------------------------------------
// kd-tree stats object
// This object is used for collecting information about a kd-tree
// or bd-tree.
//----------------------------------------------------------------------
class ANNkdStats { // stats on kd-tree
public:
int dim; // dimension of space
int n_pts; // no. of points
int bkt_size; // bucket size
int n_lf; // no. of leaves (including trivial)
int n_tl; // no. of trivial leaves (no points)
int n_spl; // no. of splitting nodes
int n_shr; // no. of shrinking nodes (for bd-trees)
int depth; // depth of tree
float sum_ar; // sum of leaf aspect ratios
float avg_ar; // average leaf aspect ratio
//
// reset stats
void reset(int d=0, int n=0, int bs=0)
{
dim = d; n_pts = n; bkt_size = bs;
n_lf = n_tl = n_spl = n_shr = depth = 0;
sum_ar = avg_ar = 0.0;
}
ANNkdStats() // basic constructor
{ reset(); }
void merge(const ANNkdStats &st); // merge stats from child
};
//----------------------------------------------------------------------
// ANNsampStat
// A sample stat collects numeric (double) samples and returns some
// simple statistics. Its main functions are:
//
// reset() Reset to no samples.
// += x Include sample x.
// samples() Return number of samples.
// mean() Return mean of samples.
// stdDev() Return standard deviation
// min() Return minimum of samples.
// max() Return maximum of samples.
//----------------------------------------------------------------------
class DLL_API ANNsampStat {
int n; // number of samples
double sum; // sum
double sum2; // sum of squares
double minVal, maxVal; // min and max
public :
void reset() // reset everything
{
n = 0;
sum = sum2 = 0;
minVal = ANN_DBL_MAX;
maxVal = -ANN_DBL_MAX;
}
ANNsampStat() { reset(); } // constructor
void operator+=(double x) // add sample
{
n++; sum += x; sum2 += x*x;
if (x < minVal) minVal = x;
if (x > maxVal) maxVal = x;
}
int samples() { return n; } // number of samples
double mean() { return sum/n; } // mean
// standard deviation
double stdDev() { return sqrt((sum2 - (sum*sum)/n)/(n-1));}
double min() { return minVal; } // minimum
double max() { return maxVal; } // maximum
};
//----------------------------------------------------------------------
// Operation count updates
//----------------------------------------------------------------------
#ifdef ANN_PERF
#define ANN_FLOP(n) {ann_Nfloat_ops += (n);}
#define ANN_LEAF(n) {ann_Nvisit_lfs += (n);}
#define ANN_SPL(n) {ann_Nvisit_spl += (n);}
#define ANN_SHR(n) {ann_Nvisit_shr += (n);}
#define ANN_PTS(n) {ann_Nvisit_pts += (n);}
#define ANN_COORD(n) {ann_Ncoord_hts += (n);}
#else
#define ANN_FLOP(n)
#define ANN_LEAF(n)
#define ANN_SPL(n)
#define ANN_SHR(n)
#define ANN_PTS(n)
#define ANN_COORD(n)
#endif
//----------------------------------------------------------------------
// Performance statistics
// The following data and routines are used for computing performance
// statistics for nearest neighbor searching. Because these routines
// can slow the code down, they can be activated and deactiviated by
// defining the ANN_PERF variable, by compiling with the option:
// -DANN_PERF
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Global counters for performance measurement
//
// visit_lfs The number of leaf nodes visited in the
// tree.
//
// visit_spl The number of splitting nodes visited in the
// tree.
//
// visit_shr The number of shrinking nodes visited in the
// tree.
//
// visit_pts The number of points visited in all the
// leaf nodes visited. Equivalently, this
// is the number of points for which distance
// calculations are performed.
//
// coord_hts The number of times a coordinate of a
// data point is accessed. This is generally
// less than visit_pts*d if partial distance
// calculation is used. This count is low
// in the sense that if a coordinate is hit
// many times in the same routine we may
// count it only once.
//
// float_ops The number of floating point operations.
// This includes all operations in the heap
// as well as distance calculations to boxes.
//
// average_err The average error of each query (the
// error of the reported point to the true
// nearest neighbor). For k nearest neighbors
// the error is computed k times.
//
// rank_err The rank error of each query (the difference
// in the rank of the reported point and its
// true rank).
//
// data_pts The number of data points. This is not
// a counter, but used in stats computation.
//----------------------------------------------------------------------
extern int ann_Ndata_pts; // number of data points
extern int ann_Nvisit_lfs; // number of leaf nodes visited
extern int ann_Nvisit_spl; // number of splitting nodes visited
extern int ann_Nvisit_shr; // number of shrinking nodes visited
extern int ann_Nvisit_pts; // visited points for one query
extern int ann_Ncoord_hts; // coordinate hits for one query
extern int ann_Nfloat_ops; // floating ops for one query
extern ANNsampStat ann_visit_lfs; // stats on leaf nodes visits
extern ANNsampStat ann_visit_spl; // stats on splitting nodes visits
extern ANNsampStat ann_visit_shr; // stats on shrinking nodes visits
extern ANNsampStat ann_visit_nds; // stats on total nodes visits
extern ANNsampStat ann_visit_pts; // stats on points visited
extern ANNsampStat ann_coord_hts; // stats on coordinate hits
extern ANNsampStat ann_float_ops; // stats on floating ops
//----------------------------------------------------------------------
// The following need to be part of the public interface, because
// they are accessed outside the DLL in ann_test.cpp.
//----------------------------------------------------------------------
DLL_API extern ANNsampStat ann_average_err; // average error
DLL_API extern ANNsampStat ann_rank_err; // rank error
//----------------------------------------------------------------------
// Declaration of externally accessible routines for statistics
//----------------------------------------------------------------------
DLL_API void annResetStats(int data_size); // reset stats for a set of queries
DLL_API void annResetCounts(); // reset counts for one queries
DLL_API void annUpdateStats(); // update stats with current counts
DLL_API void annPrintStats(ANNbool validate); // print statistics for a run
#endif
-167
View File
@@ -1,167 +0,0 @@
//----------------------------------------------------------------------
// File: ANNx.h
// Programmer: Sunil Arya and David Mount
// Last modified: 03/04/98 (Release 0.1)
// Description: Internal include file for ANN
//
// These declarations are of use in manipulating some of
// the internal data objects appearing in ANN, but are not
// needed for applications just using the nearest neighbor
// search.
//
// Typical users of ANN should not need to access this file.
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Changed LO, HI, IN, OUT to ANN_LO, ANN_HI, etc.
//----------------------------------------------------------------------
#ifndef ANNx_H
#define ANNx_H
#include <iomanip> // I/O manipulators
#include <ANN/ANN.h> // ANN includes
//----------------------------------------------------------------------
// Global constants and types
//----------------------------------------------------------------------
enum {ANN_LO=0, ANN_HI=1}; // splitting indices
enum {ANN_IN=0, ANN_OUT=1}; // shrinking indices
// what to do in case of error
enum ANNerr {ANNwarn = 0, ANNabort = 1};
//----------------------------------------------------------------------
// Maximum number of points to visit
// We have an option for terminating the search early if the
// number of points visited exceeds some threshold. If the
// threshold is 0 (its default) this means there is no limit
// and the algorithm applies its normal termination condition.
//----------------------------------------------------------------------
extern int ANNmaxPtsVisited; // maximum number of pts visited
extern int ANNptsVisited; // number of pts visited in search
//----------------------------------------------------------------------
// Global function declarations
//----------------------------------------------------------------------
void annError( // ANN error routine
char *msg, // error message
ANNerr level); // level of error
void annPrintPt( // print a point
ANNpoint pt, // the point
int dim, // the dimension
std::ostream &out); // output stream
//----------------------------------------------------------------------
// Orthogonal (axis aligned) rectangle
// Orthogonal rectangles are represented by two points, one
// for the lower left corner (min coordinates) and the other
// for the upper right corner (max coordinates).
//
// The constructor initializes from either a pair of coordinates,
// pair of points, or another rectangle. Note that all constructors
// allocate new point storage. The destructor deallocates this
// storage.
//
// BEWARE: Orthogonal rectangles should be passed ONLY BY REFERENCE.
// (C++'s default copy constructor will not allocate new point
// storage, then on return the destructor free's storage, and then
// you get into big trouble in the calling procedure.)
//----------------------------------------------------------------------
class ANNorthRect {
public:
ANNpoint lo; // rectangle lower bounds
ANNpoint hi; // rectangle upper bounds
//
ANNorthRect( // basic constructor
int dd, // dimension of space
ANNcoord l=0, // default is empty
ANNcoord h=0)
{ lo = annAllocPt(dd, l); hi = annAllocPt(dd, h); }
ANNorthRect( // (almost a) copy constructor
int dd, // dimension
const ANNorthRect &r) // rectangle to copy
{ lo = annCopyPt(dd, r.lo); hi = annCopyPt(dd, r.hi); }
ANNorthRect( // construct from points
int dd, // dimension
ANNpoint l, // low point
ANNpoint h) // hight point
{ lo = annCopyPt(dd, l); hi = annCopyPt(dd, h); }
~ANNorthRect() // destructor
{ annDeallocPt(lo); annDeallocPt(hi); }
ANNbool inside(int dim, ANNpoint p);// is point p inside rectangle?
};
void annAssignRect( // assign one rect to another
int dim, // dimension (both must be same)
ANNorthRect &dest, // destination (modified)
const ANNorthRect &source); // source
//----------------------------------------------------------------------
// Orthogonal (axis aligned) halfspace
// An orthogonal halfspace is represented by an integer cutting
// dimension cd, coordinate cutting value, cv, and side, sd, which is
// either +1 or -1. Our convention is that point q lies in the (closed)
// halfspace if (q[cd] - cv)*sd >= 0.
//----------------------------------------------------------------------
class ANNorthHalfSpace {
public:
int cd; // cutting dimension
ANNcoord cv; // cutting value
int sd; // which side
//
ANNorthHalfSpace() // default constructor
{ cd = 0; cv = 0; sd = 0; }
ANNorthHalfSpace( // basic constructor
int cdd, // dimension of space
ANNcoord cvv, // cutting value
int sdd) // side
{ cd = cdd; cv = cvv; sd = sdd; }
ANNbool in(ANNpoint q) const // is q inside halfspace?
{ return (ANNbool) ((q[cd] - cv)*sd >= 0); }
ANNbool out(ANNpoint q) const // is q outside halfspace?
{ return (ANNbool) ((q[cd] - cv)*sd < 0); }
ANNdist dist(ANNpoint q) const // (squared) distance from q
{ return (ANNdist) ANN_POW(q[cd] - cv); }
void setLowerBound(int d, ANNpoint p)// set to lower bound at p[i]
{ cd = d; cv = p[d]; sd = +1; }
void setUpperBound(int d, ANNpoint p)// set to upper bound at p[i]
{ cd = d; cv = p[d]; sd = -1; }
void project(ANNpoint &q) // project q (modified) onto halfspace
{ if (out(q)) q[cd] = cv; }
};
// array of halfspaces
typedef ANNorthHalfSpace *ANNorthHSArray;
#endif
-90
View File
@@ -1,90 +0,0 @@
#-----------------------------------------------------------------------------
# Makefile for the sample program
#
# ANN: Approximate Nearest Neighbors
# Version: 1.1.1 08/04/06
#-----------------------------------------------------------------------------
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
# David Mount. All Rights Reserved.
#
# This software and related documentation is part of the Approximate
# Nearest Neighbor Library (ANN). This software is provided under
# the provisions of the Lesser GNU Public License (LGPL). See the
# file ../ReadMe.txt for further information.
#
# The University of Maryland (U.M.) and the authors make no
# representations about the suitability or fitness of this software for
# any purpose. It is provided "as is" without express or implied
# warranty.
#-----------------------------------------------------------------------------
# Revision 0.1 03/04/98
# Initial release
# Revision 1.1.1 08/04/06
# Added copyright/license
#-----------------------------------------------------------------------------
# Note: For full performance measurements, it is assumed that the library
# and this program have both been compiled with the -DPERF flag. See the
# Makefile in the ANN base directory for this flag.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Basic definitions
# BASEDIR where include, src, lib, ... are
# INCDIR include directory
# LIBDIR library directory
# BINDIR bin directory
# LDFLAGS loader flags
# ANNLIBS libraries
#-----------------------------------------------------------------------------
BASEDIR = ..
INCDIR = $(BASEDIR)/include
LIBDIR = $(BASEDIR)/lib
BINDIR = $(BASEDIR)/bin
LDFLAGS = -L$(LIBDIR)
ANNLIBS = -lANN -lm
#-----------------------------------------------------------------------------
# Some more definitions
# ANNSAMP name of sample program
#-----------------------------------------------------------------------------
ANNSAMP = ann_sample
SAMPSOURCES = ann_sample.cpp
SAMPOBJECTS = $(SAMPSOURCES:.cpp=.o)
#-----------------------------------------------------------------------------
# Make the program
#-----------------------------------------------------------------------------
default:
@echo "Specify a target configuration"
targets: $(BINDIR)/$(ANNSAMP)
$(BINDIR)/$(ANNSAMP): $(SAMPOBJECTS) $(LIBDIR)/$(ANNLIB)
$(C++) $(SAMPOBJECTS) -o $(ANNSAMP) $(LDFLAGS) $(ANNLIBS)
mv $(ANNSAMP) $(BINDIR)
#-----------------------------------------------------------------------------
# configuration definitions
#-----------------------------------------------------------------------------
include ../Make-config
#-----------------------------------------------------------------------------
# Objects
#-----------------------------------------------------------------------------
ann_sample.o: ann_sample.cpp
$(C++) -c -I$(INCDIR) $(CFLAGS) ann_sample.cpp
#-----------------------------------------------------------------------------
# Cleaning
#-----------------------------------------------------------------------------
clean:
-rm -f *.o *.out core
realclean: clean
-198
View File
@@ -1,198 +0,0 @@
//----------------------------------------------------------------------
// File: ann_sample.cpp
// Programmer: Sunil Arya and David Mount
// Last modified: 03/04/98 (Release 0.1)
// Description: Sample program for ANN
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
#include <cstdlib> // C standard library
#include <cstdio> // C I/O (for sscanf)
#include <cstring> // string manipulation
#include <fstream> // file I/O
#include <ANN/ANN.h> // ANN declarations
using namespace std; // make std:: accessible
//----------------------------------------------------------------------
// ann_sample
//
// This is a simple sample program for the ANN library. After compiling,
// it can be run as follows.
//
// ann_sample [-d dim] [-max mpts] [-nn k] [-e eps] [-df data] [-qf query]
//
// where
// dim is the dimension of the space (default = 2)
// mpts maximum number of data points (default = 1000)
// k number of nearest neighbors per query (default 1)
// eps is the error bound (default = 0.0)
// data file containing data points
// query file containing query points
//
// Results are sent to the standard output.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Parameters that are set in getArgs()
//----------------------------------------------------------------------
void getArgs(int argc, char **argv); // get command-line arguments
int k = 1; // number of nearest neighbors
int dim = 2; // dimension
double eps = 0; // error bound
int maxPts = 1000; // maximum number of data points
istream* dataIn = NULL; // input for data points
istream* queryIn = NULL; // input for query points
bool readPt(istream &in, ANNpoint p) // read point (false on EOF)
{
for (int i = 0; i < dim; i++) {
if(!(in >> p[i])) return false;
}
return true;
}
void printPt(ostream &out, ANNpoint p) // print point
{
out << "(" << p[0];
for (int i = 1; i < dim; i++) {
out << ", " << p[i];
}
out << ")\n";
}
int main(int argc, char **argv)
{
int nPts; // actual number of data points
ANNpointArray dataPts; // data points
ANNpoint queryPt; // query point
ANNidxArray nnIdx; // near neighbor indices
ANNdistArray dists; // near neighbor distances
ANNkd_tree* kdTree; // search structure
getArgs(argc, argv); // read command-line arguments
queryPt = annAllocPt(dim); // allocate query point
dataPts = annAllocPts(maxPts, dim); // allocate data points
nnIdx = new ANNidx[k]; // allocate near neigh indices
dists = new ANNdist[k]; // allocate near neighbor dists
nPts = 0; // read data points
cout << "Data Points:\n";
while (nPts < maxPts && readPt(*dataIn, dataPts[nPts])) {
printPt(cout, dataPts[nPts]);
nPts++;
}
kdTree = new ANNkd_tree( // build search structure
dataPts, // the data points
nPts, // number of points
dim); // dimension of space
while (readPt(*queryIn, queryPt)) { // read query points
cout << "Query point: "; // echo query point
printPt(cout, queryPt);
kdTree->annkSearch( // search
queryPt, // query point
k, // number of near neighbors
nnIdx, // nearest neighbors (returned)
dists, // distance (returned)
eps); // error bound
cout << "\tNN:\tIndex\tDistance\n";
for (int i = 0; i < k; i++) { // print summary
dists[i] = sqrt(dists[i]); // unsquare distance
cout << "\t" << i << "\t" << nnIdx[i] << "\t" << dists[i] << "\n";
}
}
delete [] nnIdx; // clean things up
delete [] dists;
delete kdTree;
annClose(); // done with ANN
return EXIT_SUCCESS;
}
//----------------------------------------------------------------------
// getArgs - get command line arguments
//----------------------------------------------------------------------
void getArgs(int argc, char **argv)
{
static ifstream dataStream; // data file stream
static ifstream queryStream; // query file stream
if (argc <= 1) { // no arguments
cerr << "Usage:\n\n"
<< " ann_sample [-d dim] [-max m] [-nn k] [-e eps] [-df data]"
" [-qf query]\n\n"
<< " where:\n"
<< " dim dimension of the space (default = 2)\n"
<< " m maximum number of data points (default = 1000)\n"
<< " k number of nearest neighbors per query (default 1)\n"
<< " eps the error bound (default = 0.0)\n"
<< " data name of file containing data points\n"
<< " query name of file containing query points\n\n"
<< " Results are sent to the standard output.\n"
<< "\n"
<< " To run this demo use:\n"
<< " ann_sample -df data.pts -qf query.pts\n";
exit(0);
}
int i = 1;
while (i < argc) { // read arguments
if (!strcmp(argv[i], "-d")) { // -d option
dim = atoi(argv[++i]); // get dimension to dump
}
else if (!strcmp(argv[i], "-max")) { // -max option
maxPts = atoi(argv[++i]); // get max number of points
}
else if (!strcmp(argv[i], "-nn")) { // -nn option
k = atoi(argv[++i]); // get number of near neighbors
}
else if (!strcmp(argv[i], "-e")) { // -e option
sscanf(argv[++i], "%lf", &eps); // get error bound
}
else if (!strcmp(argv[i], "-df")) { // -df option
dataStream.open(argv[++i], ios::in);// open data file
if (!dataStream) {
cerr << "Cannot open data file\n";
exit(1);
}
dataIn = &dataStream; // make this the data stream
}
else if (!strcmp(argv[i], "-qf")) { // -qf option
queryStream.open(argv[++i], ios::in);// open query file
if (!queryStream) {
cerr << "Cannot open query file\n";
exit(1);
}
queryIn = &queryStream; // make this query stream
}
else { // illegal syntax
cerr << "Unrecognized option.\n";
exit(1);
}
i++;
}
if (dataIn == NULL || queryIn == NULL) {
cerr << "-df and -qf options must be specified\n";
exit(1);
}
}
-20
View File
@@ -1,20 +0,0 @@
-0.297462 0.176102
0.565538 -0.361496
0.909313 -0.182785
0.920712 0.478408
0.167682 0.0499836
0.305223 -0.0805835
0.114973 0.882453
0.742916 0.16376
0.0724605 -0.826775
0.690960 -0.559284
0.188485 -0.643934
0.749427 -0.942415
-0.970662 -0.223466
0.916110 0.879597
0.927417 -0.382593
-0.711327 0.278713
-0.519172 0.986146
0.135338 0.924588
-0.0837537 0.61687
0.0520465 0.896306
-10
View File
@@ -1,10 +0,0 @@
0.0902484 -0.207129
-0.419567 0.485743
0.826225 -0.30962
0.694758 0.987088
-0.410807 -0.465182
-0.836501 0.490184
0.588289 0.656408
0.325807 0.38721
-0.532226 -0.727036
-0.52506 -0.853508
-51
View File
@@ -1,51 +0,0 @@
Data Points:
(-0.297462, 0.176102)
(0.565538, -0.361496)
(0.909313, -0.182785)
(0.920712, 0.478408)
(0.167682, 0.0499836)
(0.305223, -0.0805835)
(0.114973, 0.882453)
(0.742916, 0.16376)
(0.0724605, -0.826775)
(0.69096, -0.559284)
(0.188485, -0.643934)
(0.749427, -0.942415)
(-0.970662, -0.223466)
(0.91611, 0.879597)
(0.927417, -0.382593)
(-0.711327, 0.278713)
(-0.519172, 0.986146)
(0.135338, 0.924588)
(-0.0837537, 0.61687)
(0.0520465, 0.896306)
Query point: (0.0902484, -0.207129)
NN: Index Distance
0 5 0.249455
Query point: (-0.419567, 0.485743)
NN: Index Distance
0 0 0.332847
Query point: (0.826225, -0.30962)
NN: Index Distance
0 14 0.124759
Query point: (0.694758, 0.987088)
NN: Index Distance
0 13 0.246071
Query point: (-0.410807, -0.465182)
NN: Index Distance
0 8 0.60357
Query point: (-0.836501, 0.490184)
NN: Index Distance
0 15 0.245741
Query point: (0.588289, 0.656408)
NN: Index Distance
0 3 0.37708
Query point: (0.325807, 0.38721)
NN: Index Distance
0 4 0.372458
Query point: (-0.532226, -0.727036)
NN: Index Distance
0 8 0.612857
Query point: (-0.52506, -0.853508)
NN: Index Distance
0 8 0.598118
-199
View File
@@ -1,199 +0,0 @@
//----------------------------------------------------------------------
// File: ANN.cpp
// Programmer: Sunil Arya and David Mount
// Description: Methods for ANN.h and ANNx.h
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Added performance counting to annDist()
//----------------------------------------------------------------------
#include <ANN/ANNx.h> // all ANN includes
#include <ANN/ANNperf.h> // ANN performance
#include <cstdlib>
using namespace std; // make std:: accessible
//----------------------------------------------------------------------
// Point methods
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Distance utility.
// (Note: In the nearest neighbor search, most distances are
// computed using partial distance calculations, not this
// procedure.)
//----------------------------------------------------------------------
ANNdist annDist( // interpoint squared distance
int dim,
ANNpoint p,
ANNpoint q)
{
register int d;
register ANNcoord diff;
register ANNcoord dist;
dist = 0;
for (d = 0; d < dim; d++) {
diff = p[d] - q[d];
dist = ANN_SUM(dist, ANN_POW(diff));
}
ANN_FLOP(3*dim) // performance counts
ANN_PTS(1)
ANN_COORD(dim)
return dist;
}
//----------------------------------------------------------------------
// annPrintPoint() prints a point to a given output stream.
//----------------------------------------------------------------------
void annPrintPt( // print a point
ANNpoint pt, // the point
int dim, // the dimension
std::ostream &out) // output stream
{
for (int j = 0; j < dim; j++) {
out << pt[j];
if (j < dim-1) out << " ";
}
}
//----------------------------------------------------------------------
// Point allocation/deallocation:
//
// Because points (somewhat like strings in C) are stored
// as pointers. Consequently, creating and destroying
// copies of points may require storage allocation. These
// procedures do this.
//
// annAllocPt() and annDeallocPt() allocate a deallocate
// storage for a single point, and return a pointer to it.
//
// annAllocPts() allocates an array of points as well a place
// to store their coordinates, and initializes the points to
// point to their respective coordinates. It allocates point
// storage in a contiguous block large enough to store all the
// points. It performs no initialization.
//
// annDeallocPts() should only be used on point arrays allocated
// by annAllocPts since it assumes that points are allocated in
// a block.
//
// annCopyPt() copies a point taking care to allocate storage
// for the new point.
//
// annAssignRect() assigns the coordinates of one rectangle to
// another. The two rectangles must have the same dimension
// (and it is not possible to test this here).
//----------------------------------------------------------------------
ANNpoint annAllocPt(int dim, ANNcoord c) // allocate 1 point
{
ANNpoint p = new ANNcoord[dim];
for (int i = 0; i < dim; i++) p[i] = c;
return p;
}
ANNpointArray annAllocPts(int n, int dim) // allocate n pts in dim
{
ANNpointArray pa = new ANNpoint[n]; // allocate points
ANNpoint p = new ANNcoord[n*dim]; // allocate space for coords
for (int i = 0; i < n; i++) {
pa[i] = &(p[i*dim]);
}
return pa;
}
void annDeallocPt(ANNpoint &p) // deallocate 1 point
{
delete [] p;
p = NULL;
}
void annDeallocPts(ANNpointArray &pa) // deallocate points
{
delete [] pa[0]; // dealloc coordinate storage
delete [] pa; // dealloc points
pa = NULL;
}
ANNpoint annCopyPt(int dim, ANNpoint source) // copy point
{
ANNpoint p = new ANNcoord[dim];
for (int i = 0; i < dim; i++) p[i] = source[i];
return p;
}
// assign one rect to another
void annAssignRect(int dim, ANNorthRect &dest, const ANNorthRect &source)
{
for (int i = 0; i < dim; i++) {
dest.lo[i] = source.lo[i];
dest.hi[i] = source.hi[i];
}
}
// is point inside rectangle?
ANNbool ANNorthRect::inside(int dim, ANNpoint p)
{
for (int i = 0; i < dim; i++) {
if (p[i] < lo[i] || p[i] > hi[i]) return ANNfalse;
}
return ANNtrue;
}
//----------------------------------------------------------------------
// Error handler
//----------------------------------------------------------------------
void annError(char *msg, ANNerr level)
{
if (level == ANNabort) {
cerr << "ANN: ERROR------->" << msg << "<-------------ERROR\n";
exit(1);
}
else {
cerr << "ANN: WARNING----->" << msg << "<-------------WARNING\n";
}
}
//----------------------------------------------------------------------
// Limit on number of points visited
// We have an option for terminating the search early if the
// number of points visited exceeds some threshold. If the
// threshold is 0 (its default) this means there is no limit
// and the algorithm applies its normal termination condition.
// This is for applications where there are real time constraints
// on the running time of the algorithm.
//----------------------------------------------------------------------
int ANNmaxPtsVisited = 0; // maximum number of pts visited
int ANNptsVisited; // number of pts visited in search
//----------------------------------------------------------------------
// Global function declarations
//----------------------------------------------------------------------
void annMaxPtsVisit( // set limit on max. pts to visit in search
int maxPts) // the limit
{
ANNmaxPtsVisited = maxPts;
}
-29
View File
@@ -1,29 +0,0 @@
add_definitions(-D_USRDLL -DDLL_EXPORTS -DANN_PERF -DANN_NO_RANDOM)
include_directories(../include)
set(ANN_SRCS
ANN.cpp brute.cpp kd_tree.cpp kd_util.cpp kd_split.cpp
kd_dump.cpp kd_search.cpp kd_pr_search.cpp kd_fix_rad_search.cpp
bd_tree.cpp bd_search.cpp bd_pr_search.cpp bd_fix_rad_search.cpp
perf.cpp bd_tree.h kd_tree.h kd_split.h kd_util.h kd_search.h
kd_pr_search.h kd_fix_rad_search.h pr_queue.h pr_queue_k.h
../include/ANN/ANN.h ../include/ANN/ANNperf.h ../include/ANN/ANNx.h
)
if(WIN32)
set(ANN_LIBS
debug MSVCRTD.LIB
debug MSVCPRTD.LIB
optimized MSVCRT.LIB
optimized MSVCPRT.LIB
Rpcrt4.lib
)
endif(WIN32)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/src/Main)
add_library(ANN SHARED ${ANN_SRCS})
target_link_libraries(ANN ${ANN_LIBS})
SET_BIN_DIR(ANN ANN)
-61
View File
@@ -1,61 +0,0 @@
//----------------------------------------------------------------------
// File: bd_fix_rad_search.cpp
// Programmer: David Mount
// Description: Standard bd-tree search
// Last modified: 05/03/05 (Version 1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 1.1 05/03/05
// Initial release
//----------------------------------------------------------------------
#include "bd_tree.h" // bd-tree declarations
#include "kd_fix_rad_search.h" // kd-tree FR search declarations
//----------------------------------------------------------------------
// Approximate searching for bd-trees.
// See the file kd_FR_search.cpp for general information on the
// approximate nearest neighbor search algorithm. Here we
// include the extensions for shrinking nodes.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// bd_shrink::ann_FR_search - search a shrinking node
//----------------------------------------------------------------------
void ANNbd_shrink::ann_FR_search(ANNdist box_dist)
{
// check dist calc term cond.
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
ANNdist inner_dist = 0; // distance to inner box
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
if (bnds[i].out(ANNkdFRQ)) { // outside this bounding side?
// add to inner distance
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNkdFRQ));
}
}
if (inner_dist <= box_dist) { // if inner box is closer
child[ANN_IN]->ann_FR_search(inner_dist);// search inner child first
child[ANN_OUT]->ann_FR_search(box_dist);// ...then outer child
}
else { // if outer box is closer
child[ANN_OUT]->ann_FR_search(box_dist);// search outer child first
child[ANN_IN]->ann_FR_search(inner_dist);// ...then outer child
}
ANN_FLOP(3*n_bnds) // increment floating ops
ANN_SHR(1) // one more shrinking node
}
-62
View File
@@ -1,62 +0,0 @@
//----------------------------------------------------------------------
// File: bd_pr_search.cpp
// Programmer: David Mount
// Description: Priority search for bd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
//History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#include "bd_tree.h" // bd-tree declarations
#include "kd_pr_search.h" // kd priority search declarations
//----------------------------------------------------------------------
// Approximate priority searching for bd-trees.
// See the file kd_pr_search.cc for general information on the
// approximate nearest neighbor priority search algorithm. Here
// we include the extensions for shrinking nodes.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// bd_shrink::ann_search - search a shrinking node
//----------------------------------------------------------------------
void ANNbd_shrink::ann_pri_search(ANNdist box_dist)
{
ANNdist inner_dist = 0; // distance to inner box
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
if (bnds[i].out(ANNprQ)) { // outside this bounding side?
// add to inner distance
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNprQ));
}
}
if (inner_dist <= box_dist) { // if inner box is closer
if (child[ANN_OUT] != KD_TRIVIAL) // enqueue outer if not trivial
ANNprBoxPQ->insert(box_dist,child[ANN_OUT]);
// continue with inner child
child[ANN_IN]->ann_pri_search(inner_dist);
}
else { // if outer box is closer
if (child[ANN_IN] != KD_TRIVIAL) // enqueue inner if not trivial
ANNprBoxPQ->insert(inner_dist,child[ANN_IN]);
// continue with outer child
child[ANN_OUT]->ann_pri_search(box_dist);
}
ANN_FLOP(3*n_bnds) // increment floating ops
ANN_SHR(1) // one more shrinking node
}
-61
View File
@@ -1,61 +0,0 @@
//----------------------------------------------------------------------
// File: bd_search.cpp
// Programmer: David Mount
// Description: Standard bd-tree search
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#include "bd_tree.h" // bd-tree declarations
#include "kd_search.h" // kd-tree search declarations
//----------------------------------------------------------------------
// Approximate searching for bd-trees.
// See the file kd_search.cpp for general information on the
// approximate nearest neighbor search algorithm. Here we
// include the extensions for shrinking nodes.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// bd_shrink::ann_search - search a shrinking node
//----------------------------------------------------------------------
void ANNbd_shrink::ann_search(ANNdist box_dist)
{
// check dist calc term cond.
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
ANNdist inner_dist = 0; // distance to inner box
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
if (bnds[i].out(ANNkdQ)) { // outside this bounding side?
// add to inner distance
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNkdQ));
}
}
if (inner_dist <= box_dist) { // if inner box is closer
child[ANN_IN]->ann_search(inner_dist); // search inner child first
child[ANN_OUT]->ann_search(box_dist); // ...then outer child
}
else { // if outer box is closer
child[ANN_OUT]->ann_search(box_dist); // search outer child first
child[ANN_IN]->ann_search(inner_dist); // ...then outer child
}
ANN_FLOP(3*n_bnds) // increment floating ops
ANN_SHR(1) // one more shrinking node
}
-417
View File
@@ -1,417 +0,0 @@
//----------------------------------------------------------------------
// File: bd_tree.cpp
// Programmer: David Mount
// Description: Basic methods for bd-trees.
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision l.0 04/01/05
// Fixed centroid shrink threshold condition to depend on the
// dimension.
// Moved dump routine to kd_dump.cpp.
//----------------------------------------------------------------------
#include "bd_tree.h" // bd-tree declarations
#include "kd_util.h" // kd-tree utilities
#include "kd_split.h" // kd-tree splitting rules
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Printing a bd-tree
// These routines print a bd-tree. See the analogous procedure
// in kd_tree.cpp for more information.
//----------------------------------------------------------------------
void ANNbd_shrink::print( // print shrinking node
int level, // depth of node in tree
ostream &out) // output stream
{
child[ANN_OUT]->print(level+1, out); // print out-child
out << " ";
for (int i = 0; i < level; i++) // print indentation
out << "..";
out << "Shrink";
for (int j = 0; j < n_bnds; j++) { // print sides, 2 per line
if (j % 2 == 0) {
out << "\n"; // newline and indentation
for (int i = 0; i < level+2; i++) out << " ";
}
out << " ([" << bnds[j].cd << "]"
<< (bnds[j].sd > 0 ? ">=" : "< ")
<< bnds[j].cv << ")";
}
out << "\n";
child[ANN_IN]->print(level+1, out); // print in-child
}
//----------------------------------------------------------------------
// kd_tree statistics utility (for performance evaluation)
// This routine computes various statistics information for
// shrinking nodes. See file kd_tree.cpp for more information.
//----------------------------------------------------------------------
void ANNbd_shrink::getStats( // get subtree statistics
int dim, // dimension of space
ANNkdStats &st, // stats (modified)
ANNorthRect &bnd_box) // bounding box
{
ANNkdStats ch_stats; // stats for children
ANNorthRect inner_box(dim); // inner box of shrink
annBnds2Box(bnd_box, // enclosing box
dim, // dimension
n_bnds, // number of bounds
bnds, // bounds array
inner_box); // inner box (modified)
// get stats for inner child
ch_stats.reset(); // reset
child[ANN_IN]->getStats(dim, ch_stats, inner_box);
st.merge(ch_stats); // merge them
// get stats for outer child
ch_stats.reset(); // reset
child[ANN_OUT]->getStats(dim, ch_stats, bnd_box);
st.merge(ch_stats); // merge them
st.depth++; // increment depth
st.n_shr++; // increment number of shrinks
}
//----------------------------------------------------------------------
// bd-tree constructor
// This is the main constructor for bd-trees given a set of points.
// It first builds a skeleton kd-tree as a basis, then computes the
// bounding box of the data points, and then invokes rbd_tree() to
// actually build the tree, passing it the appropriate splitting
// and shrinking information.
//----------------------------------------------------------------------
ANNkd_ptr rbd_tree( // recursive construction of bd-tree
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
int bsp, // bucket space
ANNorthRect &bnd_box, // bounding box for current node
ANNkd_splitter splitter, // splitting routine
ANNshrinkRule shrink); // shrinking rule
ANNbd_tree::ANNbd_tree( // construct from point array
ANNpointArray pa, // point array (with at least n pts)
int n, // number of points
int dd, // dimension
int bs, // bucket size
ANNsplitRule split, // splitting rule
ANNshrinkRule shrink) // shrinking rule
: ANNkd_tree(n, dd, bs) // build skeleton base tree
{
pts = pa; // where the points are
if (n == 0) return; // no points--no sweat
ANNorthRect bnd_box(dd); // bounding box for points
// construct bounding rectangle
annEnclRect(pa, pidx, n, dd, bnd_box);
// copy to tree structure
bnd_box_lo = annCopyPt(dd, bnd_box.lo);
bnd_box_hi = annCopyPt(dd, bnd_box.hi);
switch (split) { // build by rule
case ANN_KD_STD: // standard kd-splitting rule
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split, shrink);
break;
case ANN_KD_MIDPT: // midpoint split
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split, shrink);
break;
case ANN_KD_SUGGEST: // best (in our opinion)
case ANN_KD_SL_MIDPT: // sliding midpoint split
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split, shrink);
break;
case ANN_KD_FAIR: // fair split
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split, shrink);
break;
case ANN_KD_SL_FAIR: // sliding fair split
root = rbd_tree(pa, pidx, n, dd, bs,
bnd_box, sl_fair_split, shrink);
break;
default:
annError("Illegal splitting method", ANNabort);
}
}
//----------------------------------------------------------------------
// Shrinking rules
//----------------------------------------------------------------------
enum ANNdecomp {SPLIT, SHRINK}; // decomposition methods
//----------------------------------------------------------------------
// trySimpleShrink - Attempt a simple shrink
//
// We compute the tight bounding box of the points, and compute
// the 2*dim ``gaps'' between the sides of the tight box and the
// bounding box. If any of the gaps is large enough relative to
// the longest side of the tight bounding box, then we shrink
// all sides whose gaps are large enough. (The reason for
// comparing against the tight bounding box, is that after
// shrinking the longest box size will decrease, and if we use
// the standard bounding box, we may decide to shrink twice in
// a row. Since the tight box is fixed, we cannot shrink twice
// consecutively.)
//----------------------------------------------------------------------
const float BD_GAP_THRESH = 0.5; // gap threshold (must be < 1)
const int BD_CT_THRESH = 2; // min number of shrink sides
ANNdecomp trySimpleShrink( // try a simple shrink
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
const ANNorthRect &bnd_box, // current bounding box
ANNorthRect &inner_box) // inner box if shrinking (returned)
{
int i;
// compute tight bounding box
annEnclRect(pa, pidx, n, dim, inner_box);
ANNcoord max_length = 0; // find longest box side
for (i = 0; i < dim; i++) {
ANNcoord length = inner_box.hi[i] - inner_box.lo[i];
if (length > max_length) {
max_length = length;
}
}
int shrink_ct = 0; // number of sides we shrunk
for (i = 0; i < dim; i++) { // select which sides to shrink
// gap between boxes
ANNcoord gap_hi = bnd_box.hi[i] - inner_box.hi[i];
// big enough gap to shrink?
if (gap_hi < max_length*BD_GAP_THRESH)
inner_box.hi[i] = bnd_box.hi[i]; // no - expand
else shrink_ct++; // yes - shrink this side
// repeat for high side
ANNcoord gap_lo = inner_box.lo[i] - bnd_box.lo[i];
if (gap_lo < max_length*BD_GAP_THRESH)
inner_box.lo[i] = bnd_box.lo[i]; // no - expand
else shrink_ct++; // yes - shrink this side
}
if (shrink_ct >= BD_CT_THRESH) // did we shrink enough sides?
return SHRINK;
else return SPLIT;
}
//----------------------------------------------------------------------
// tryCentroidShrink - Attempt a centroid shrink
//
// We repeatedly apply the splitting rule, always to the larger subset
// of points, until the number of points decreases by the constant
// fraction BD_FRACTION. If this takes more than dim*BD_MAX_SPLIT_FAC
// splits for this to happen, then we shrink to the final inner box
// Otherwise we split.
//----------------------------------------------------------------------
const float BD_MAX_SPLIT_FAC = 0.5; // maximum number of splits allowed
const float BD_FRACTION = 0.5; // ...to reduce points by this fraction
// ...This must be < 1.
ANNdecomp tryCentroidShrink( // try a centroid shrink
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
const ANNorthRect &bnd_box, // current bounding box
ANNkd_splitter splitter, // splitting procedure
ANNorthRect &inner_box) // inner box if shrinking (returned)
{
int n_sub = n; // number of points in subset
int n_goal = (int) (n*BD_FRACTION); // number of point in goal
int n_splits = 0; // number of splits needed
// initialize inner box to bounding box
annAssignRect(dim, inner_box, bnd_box);
while (n_sub > n_goal) { // keep splitting until goal reached
int cd; // cut dim from splitter (ignored)
ANNcoord cv; // cut value from splitter (ignored)
int n_lo; // number of points on low side
// invoke splitting procedure
(*splitter)(pa, pidx, inner_box, n_sub, dim, cd, cv, n_lo);
n_splits++; // increment split count
if (n_lo >= n_sub/2) { // most points on low side
inner_box.hi[cd] = cv; // collapse high side
n_sub = n_lo; // recurse on lower points
}
else { // most points on high side
inner_box.lo[cd] = cv; // collapse low side
pidx += n_lo; // recurse on higher points
n_sub -= n_lo;
}
}
if (n_splits > dim*BD_MAX_SPLIT_FAC)// took too many splits
return SHRINK; // shrink to final subset
else
return SPLIT;
}
//----------------------------------------------------------------------
// selectDecomp - select which decomposition to use
//----------------------------------------------------------------------
ANNdecomp selectDecomp( // select decomposition method
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
const ANNorthRect &bnd_box, // current bounding box
ANNkd_splitter splitter, // splitting procedure
ANNshrinkRule shrink, // shrinking rule
ANNorthRect &inner_box) // inner box if shrinking (returned)
{
ANNdecomp decomp = SPLIT; // decomposition
switch (shrink) { // check shrinking rule
case ANN_BD_NONE: // no shrinking allowed
decomp = SPLIT;
break;
case ANN_BD_SUGGEST: // author's suggestion
case ANN_BD_SIMPLE: // simple shrink
decomp = trySimpleShrink(
pa, pidx, // points and indices
n, dim, // number of points and dimension
bnd_box, // current bounding box
inner_box); // inner box if shrinking (returned)
break;
case ANN_BD_CENTROID: // centroid shrink
decomp = tryCentroidShrink(
pa, pidx, // points and indices
n, dim, // number of points and dimension
bnd_box, // current bounding box
splitter, // splitting procedure
inner_box); // inner box if shrinking (returned)
break;
default:
annError("Illegal shrinking rule", ANNabort);
}
return decomp;
}
//----------------------------------------------------------------------
// rbd_tree - recursive procedure to build a bd-tree
//
// This is analogous to rkd_tree, but for bd-trees. See the
// procedure rkd_tree() in kd_split.cpp for more information.
//
// If the number of points falls below the bucket size, then a
// leaf node is created for the points. Otherwise we invoke the
// procedure selectDecomp() which determines whether we are to
// split or shrink. If splitting is chosen, then we essentially
// do exactly as rkd_tree() would, and invoke the specified
// splitting procedure to the points. Otherwise, the selection
// procedure returns a bounding box, from which we extract the
// appropriate shrinking bounds, and create a shrinking node.
// Finally the points are subdivided, and the procedure is
// invoked recursively on the two subsets to form the children.
//----------------------------------------------------------------------
ANNkd_ptr rbd_tree( // recursive construction of bd-tree
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
int bsp, // bucket space
ANNorthRect &bnd_box, // bounding box for current node
ANNkd_splitter splitter, // splitting routine
ANNshrinkRule shrink) // shrinking rule
{
ANNdecomp decomp; // decomposition method
ANNorthRect inner_box(dim); // inner box (if shrinking)
if (n <= bsp) { // n small, make a leaf node
if (n == 0) // empty leaf node
return KD_TRIVIAL; // return (canonical) empty leaf
else // construct the node and return
return new ANNkd_leaf(n, pidx);
}
decomp = selectDecomp( // select decomposition method
pa, pidx, // points and indices
n, dim, // number of points and dimension
bnd_box, // current bounding box
splitter, shrink, // splitting/shrinking methods
inner_box); // inner box if shrinking (returned)
if (decomp == SPLIT) { // split selected
int cd; // cutting dimension
ANNcoord cv; // cutting value
int n_lo; // number on low side of cut
// invoke splitting procedure
(*splitter)(pa, pidx, bnd_box, n, dim, cd, cv, n_lo);
ANNcoord lv = bnd_box.lo[cd]; // save bounds for cutting dimension
ANNcoord hv = bnd_box.hi[cd];
bnd_box.hi[cd] = cv; // modify bounds for left subtree
ANNkd_ptr lo = rbd_tree( // build left subtree
pa, pidx, n_lo, // ...from pidx[0..n_lo-1]
dim, bsp, bnd_box, splitter, shrink);
bnd_box.hi[cd] = hv; // restore bounds
bnd_box.lo[cd] = cv; // modify bounds for right subtree
ANNkd_ptr hi = rbd_tree( // build right subtree
pa, pidx + n_lo, n-n_lo,// ...from pidx[n_lo..n-1]
dim, bsp, bnd_box, splitter, shrink);
bnd_box.lo[cd] = lv; // restore bounds
// create the splitting node
return new ANNkd_split(cd, cv, lv, hv, lo, hi);
}
else { // shrink selected
int n_in; // number of points in box
int n_bnds; // number of bounding sides
annBoxSplit( // split points around inner box
pa, // points to split
pidx, // point indices
n, // number of points
dim, // dimension
inner_box, // inner box
n_in); // number of points inside (returned)
ANNkd_ptr in = rbd_tree( // build inner subtree pidx[0..n_in-1]
pa, pidx, n_in, dim, bsp, inner_box, splitter, shrink);
ANNkd_ptr out = rbd_tree( // build outer subtree pidx[n_in..n]
pa, pidx+n_in, n - n_in, dim, bsp, bnd_box, splitter, shrink);
ANNorthHSArray bnds = NULL; // bounds (alloc in Box2Bnds and
// ...freed in bd_shrink destroyer)
annBox2Bnds( // convert inner box to bounds
inner_box, // inner box
bnd_box, // enclosing box
dim, // dimension
n_bnds, // number of bounds (returned)
bnds); // bounds array (modified)
// return shrinking node
return new ANNbd_shrink(n_bnds, bnds, in, out);
}
}
-100
View File
@@ -1,100 +0,0 @@
//----------------------------------------------------------------------
// File: bd_tree.h
// Programmer: David Mount
// Description: Declarations for standard bd-tree routines
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Changed IN, OUT to ANN_IN, ANN_OUT
//----------------------------------------------------------------------
#ifndef ANN_bd_tree_H
#define ANN_bd_tree_H
#include <ANN/ANNx.h> // all ANN includes
#include "kd_tree.h" // kd-tree includes
//----------------------------------------------------------------------
// bd-tree shrinking node.
// The main addition in the bd-tree is the shrinking node, which
// is declared here.
//
// Shrinking nodes are defined by list of orthogonal halfspaces.
// These halfspaces define a (possibly unbounded) orthogonal
// rectangle. There are two children, in and out. Points that
// lie within this rectangle are stored in the in-child, and the
// other points are stored in the out-child.
//
// We use a list of orthogonal halfspaces rather than an
// orthogonal rectangle object because typically the number of
// sides of the shrinking box will be much smaller than the
// worst case bound of 2*dim.
//
// BEWARE: Note that constructor just copies the pointer to the
// bounding array, but the destructor deallocates it. This is
// rather poor practice, but happens to be convenient. The list
// is allocated in the bd-tree building procedure rbd_tree() just
// prior to construction, and is used for no other purposes.
//
// WARNING: In the near neighbor searching code it is assumed that
// the list of bounding halfspaces is irredundant, meaning that there
// are no two distinct halfspaces in the list with the same outward
// pointing normals.
//----------------------------------------------------------------------
class ANNbd_shrink : public ANNkd_node // splitting node of a kd-tree
{
int n_bnds; // number of bounding halfspaces
ANNorthHSArray bnds; // list of bounding halfspaces
ANNkd_ptr child[2]; // in and out children
public:
ANNbd_shrink( // constructor
int nb, // number of bounding halfspaces
ANNorthHSArray bds, // list of bounding halfspaces
ANNkd_ptr ic=NULL, ANNkd_ptr oc=NULL) // children
{
n_bnds = nb; // cutting dimension
bnds = bds; // assign bounds
child[ANN_IN] = ic; // set children
child[ANN_OUT] = oc;
}
~ANNbd_shrink() // destructor
{
if (child[ANN_IN]!= NULL && child[ANN_IN]!= KD_TRIVIAL)
delete child[ANN_IN];
if (child[ANN_OUT]!= NULL&& child[ANN_OUT]!= KD_TRIVIAL)
delete child[ANN_OUT];
if (bnds != NULL)
delete [] bnds; // delete bounds
}
virtual void getStats( // get tree statistics
int dim, // dimension of space
ANNkdStats &st, // statistics
ANNorthRect &bnd_box); // bounding box
virtual void print(int level, ostream &out);// print node
virtual void dump(ostream &out); // dump node
virtual void ann_search(ANNdist); // standard search
virtual void ann_pri_search(ANNdist); // priority search
virtual void ann_FR_search(ANNdist); // fixed-radius search
};
#endif
-109
View File
@@ -1,109 +0,0 @@
//----------------------------------------------------------------------
// File: brute.cpp
// Programmer: Sunil Arya and David Mount
// Description: Brute-force nearest neighbors
// Last modified: 05/03/05 (Version 1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.1 05/03/05
// Added fixed-radius kNN search
//----------------------------------------------------------------------
#include <ANN/ANNx.h> // all ANN includes
#include "pr_queue_k.h" // k element priority queue
//----------------------------------------------------------------------
// Brute-force search simply stores a pointer to the list of
// data points and searches linearly for the nearest neighbor.
// The k nearest neighbors are stored in a k-element priority
// queue (which is implemented in a pretty dumb way as well).
//
// If ANN_ALLOW_SELF_MATCH is ANNfalse then data points at distance
// zero are not considered.
//
// Note that the error bound eps is passed in, but it is ignored.
// These routines compute exact nearest neighbors (which is needed
// for validation purposes in ann_test.cpp).
//----------------------------------------------------------------------
ANNbruteForce::ANNbruteForce( // constructor from point array
ANNpointArray pa, // point array
int n, // number of points
int dd) // dimension
{
dim = dd; n_pts = n; pts = pa;
}
ANNbruteForce::~ANNbruteForce() { } // destructor (empty)
void ANNbruteForce::annkSearch( // approx k near neighbor search
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor indices (returned)
ANNdistArray dd, // dist to near neighbors (returned)
double eps) // error bound (ignored)
{
ANNmin_k mk(k); // construct a k-limited priority queue
int i;
if (k > n_pts) { // too many near neighbors?
annError("Requesting more near neighbors than data points", ANNabort);
}
// run every point through queue
for (i = 0; i < n_pts; i++) {
// compute distance to point
ANNdist sqDist = annDist(dim, pts[i], q);
if (ANN_ALLOW_SELF_MATCH || sqDist != 0)
mk.insert(sqDist, i);
}
for (i = 0; i < k; i++) { // extract the k closest points
dd[i] = mk.ith_smallest_key(i);
nn_idx[i] = mk.ith_smallest_info(i);
}
}
int ANNbruteForce::annkFRSearch( // approx fixed-radius kNN search
ANNpoint q, // query point
ANNdist sqRad, // squared radius
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor array (returned)
ANNdistArray dd, // dist to near neighbors (returned)
double eps) // error bound
{
ANNmin_k mk(k); // construct a k-limited priority queue
int i;
int pts_in_range = 0; // number of points in query range
// run every point through queue
for (i = 0; i < n_pts; i++) {
// compute distance to point
ANNdist sqDist = annDist(dim, pts[i], q);
if (sqDist <= sqRad && // within radius bound
(ANN_ALLOW_SELF_MATCH || sqDist != 0)) { // ...and no self match
mk.insert(sqDist, i);
pts_in_range++;
}
}
for (i = 0; i < k; i++) { // extract the k closest points
if (dd != NULL)
dd[i] = mk.ith_smallest_key(i);
if (nn_idx != NULL)
nn_idx[i] = mk.ith_smallest_info(i);
}
return pts_in_range;
}
-446
View File
@@ -1,446 +0,0 @@
//----------------------------------------------------------------------
// File: kd_dump.cc
// Programmer: David Mount
// Description: Dump and Load for kd- and bd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Moved dump out of kd_tree.cc into this file.
// Added kd-tree load constructor.
//----------------------------------------------------------------------
// This file contains routines for dumping kd-trees and bd-trees and
// reloading them. (It is an abuse of policy to include both kd- and
// bd-tree routines in the same file, sorry. There should be no problem
// in deleting the bd- versions of the routines if they are not
// desired.)
//----------------------------------------------------------------------
#include "kd_tree.h" // kd-tree declarations
#include "bd_tree.h" // bd-tree declarations
#include <cstring>
#include <cstdlib>
using namespace std; // make std:: available
//----------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------
const int STRING_LEN = 500; // maximum string length
const double EPSILON = 1E-5; // small number for float comparison
enum ANNtreeType {KD_TREE, BD_TREE}; // tree types (used in loading)
//----------------------------------------------------------------------
// Procedure declarations
//----------------------------------------------------------------------
static ANNkd_ptr annReadDump( // read dump file
istream &in, // input stream
ANNtreeType tree_type, // type of tree expected
ANNpointArray &the_pts, // new points (if applic)
ANNidxArray &the_pidx, // point indices (returned)
int &the_dim, // dimension (returned)
int &the_n_pts, // number of points (returned)
int &the_bkt_size, // bucket size (returned)
ANNpoint &the_bnd_box_lo, // low bounding point
ANNpoint &the_bnd_box_hi); // high bounding point
static ANNkd_ptr annReadTree( // read tree-part of dump file
istream &in, // input stream
ANNtreeType tree_type, // type of tree expected
ANNidxArray the_pidx, // point indices (modified)
int &next_idx); // next index (modified)
//----------------------------------------------------------------------
// ANN kd- and bd-tree Dump Format
// The dump file begins with a header containing the version of
// ANN, an optional section containing the points, followed by
// a description of the tree. The tree is printed in preorder.
//
// Format:
// #ANN <version number> <comments> [END_OF_LINE]
// points <dim> <n_pts> (point coordinates: this is optional)
// 0 <xxx> <xxx> ... <xxx> (point indices and coordinates)
// 1 <xxx> <xxx> ... <xxx>
// ...
// tree <dim> <n_pts> <bkt_size>
// <xxx> <xxx> ... <xxx> (lower end of bounding box)
// <xxx> <xxx> ... <xxx> (upper end of bounding box)
// If the tree is null, then a single line "null" is
// output. Otherwise the nodes of the tree are printed
// one per line in preorder. Leaves and splitting nodes
// have the following formats:
// Leaf node:
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
// Splitting nodes:
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
//
// For bd-trees:
//
// Shrinking nodes:
// shrink <n_bnds>
// <cut_dim> <cut_val> <side>
// <cut_dim> <cut_val> <side>
// ... (repeated n_bnds times)
//----------------------------------------------------------------------
void ANNkd_tree::Dump( // dump entire tree
ANNbool with_pts, // print points as well?
ostream &out) // output stream
{
out << "#ANN " << ANNversion << "\n";
out.precision(ANNcoordPrec); // use full precision in dumping
if (with_pts) { // print point coordinates
out << "points " << dim << " " << n_pts << "\n";
for (int i = 0; i < n_pts; i++) {
out << i << " ";
annPrintPt(pts[i], dim, out);
out << "\n";
}
}
out << "tree " // print tree elements
<< dim << " "
<< n_pts << " "
<< bkt_size << "\n";
annPrintPt(bnd_box_lo, dim, out); // print lower bound
out << "\n";
annPrintPt(bnd_box_hi, dim, out); // print upper bound
out << "\n";
if (root == NULL) // empty tree?
out << "null\n";
else {
root->dump(out); // invoke printing at root
}
out.precision(0); // restore default precision
}
void ANNkd_split::dump( // dump a splitting node
ostream &out) // output stream
{
out << "split " << cut_dim << " " << cut_val << " ";
out << cd_bnds[ANN_LO] << " " << cd_bnds[ANN_HI] << "\n";
child[ANN_LO]->dump(out); // print low child
child[ANN_HI]->dump(out); // print high child
}
void ANNkd_leaf::dump( // dump a leaf node
ostream &out) // output stream
{
if (this == KD_TRIVIAL) { // canonical trivial leaf node
out << "leaf 0\n"; // leaf no points
}
else{
out << "leaf " << n_pts;
for (int j = 0; j < n_pts; j++) {
out << " " << bkt[j];
}
out << "\n";
}
}
void ANNbd_shrink::dump( // dump a shrinking node
ostream &out) // output stream
{
out << "shrink " << n_bnds << "\n";
for (int j = 0; j < n_bnds; j++) {
out << bnds[j].cd << " " << bnds[j].cv << " " << bnds[j].sd << "\n";
}
child[ANN_IN]->dump(out); // print in-child
child[ANN_OUT]->dump(out); // print out-child
}
//----------------------------------------------------------------------
// Load kd-tree from dump file
// This rebuilds a kd-tree which was dumped to a file. The dump
// file contains all the basic tree information according to a
// preorder traversal. We assume that the dump file also contains
// point data. (This is to guarantee the consistency of the tree.)
// If not, then an error is generated.
//
// Indirectly, this procedure allocates space for points, point
// indices, all nodes in the tree, and the bounding box for the
// tree. When the tree is destroyed, all but the points are
// deallocated.
//
// This routine calls annReadDump to do all the work.
//----------------------------------------------------------------------
ANNkd_tree::ANNkd_tree( // build from dump file
istream &in) // input stream for dump file
{
int the_dim; // local dimension
int the_n_pts; // local number of points
int the_bkt_size; // local number of points
ANNpoint the_bnd_box_lo; // low bounding point
ANNpoint the_bnd_box_hi; // high bounding point
ANNpointArray the_pts; // point storage
ANNidxArray the_pidx; // point index storage
ANNkd_ptr the_root; // root of the tree
the_root = annReadDump( // read the dump file
in, // input stream
KD_TREE, // expecting a kd-tree
the_pts, // point array (returned)
the_pidx, // point indices (returned)
the_dim, the_n_pts, the_bkt_size, // basic tree info (returned)
the_bnd_box_lo, the_bnd_box_hi); // bounding box info (returned)
// create a skeletal tree
SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
bnd_box_lo = the_bnd_box_lo;
bnd_box_hi = the_bnd_box_hi;
root = the_root; // set the root
}
ANNbd_tree::ANNbd_tree( // build bd-tree from dump file
istream &in) : ANNkd_tree() // input stream for dump file
{
int the_dim; // local dimension
int the_n_pts; // local number of points
int the_bkt_size; // local number of points
ANNpoint the_bnd_box_lo; // low bounding point
ANNpoint the_bnd_box_hi; // high bounding point
ANNpointArray the_pts; // point storage
ANNidxArray the_pidx; // point index storage
ANNkd_ptr the_root; // root of the tree
the_root = annReadDump( // read the dump file
in, // input stream
BD_TREE, // expecting a bd-tree
the_pts, // point array (returned)
the_pidx, // point indices (returned)
the_dim, the_n_pts, the_bkt_size, // basic tree info (returned)
the_bnd_box_lo, the_bnd_box_hi); // bounding box info (returned)
// create a skeletal tree
SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
bnd_box_lo = the_bnd_box_lo;
bnd_box_hi = the_bnd_box_hi;
root = the_root; // set the root
}
//----------------------------------------------------------------------
// annReadDump - read a dump file
//
// This procedure reads a dump file, constructs a kd-tree
// and returns all the essential information needed to actually
// construct the tree. Because this procedure is used for
// constructing both kd-trees and bd-trees, the second argument
// is used to indicate which type of tree we are expecting.
//----------------------------------------------------------------------
static ANNkd_ptr annReadDump(
istream &in, // input stream
ANNtreeType tree_type, // type of tree expected
ANNpointArray &the_pts, // new points (returned)
ANNidxArray &the_pidx, // point indices (returned)
int &the_dim, // dimension (returned)
int &the_n_pts, // number of points (returned)
int &the_bkt_size, // bucket size (returned)
ANNpoint &the_bnd_box_lo, // low bounding point (ret'd)
ANNpoint &the_bnd_box_hi) // high bounding point (ret'd)
{
int j;
char str[STRING_LEN]; // storage for string
char version[STRING_LEN]; // ANN version number
ANNkd_ptr the_root = NULL;
//------------------------------------------------------------------
// Input file header
//------------------------------------------------------------------
in >> str; // input header
if (strcmp(str, "#ANN") != 0) { // incorrect header
annError("Incorrect header for dump file", ANNabort);
}
in.getline(version, STRING_LEN); // get version (ignore)
//------------------------------------------------------------------
// Input the points
// An array the_pts is allocated and points are read from
// the dump file.
//------------------------------------------------------------------
in >> str; // get major heading
if (strcmp(str, "points") == 0) { // points section
in >> the_dim; // input dimension
in >> the_n_pts; // number of points
// allocate point storage
the_pts = annAllocPts(the_n_pts, the_dim);
for (int i = 0; i < the_n_pts; i++) { // input point coordinates
ANNidx idx; // point index
in >> idx; // input point index
if (idx < 0 || idx >= the_n_pts) {
annError("Point index is out of range", ANNabort);
}
for (j = 0; j < the_dim; j++) {
in >> the_pts[idx][j]; // read point coordinates
}
}
in >> str; // get next major heading
}
else { // no points were input
annError("Points must be supplied in the dump file", ANNabort);
}
//------------------------------------------------------------------
// Input the tree
// After the basic header information, we invoke annReadTree
// to do all the heavy work. We create our own array of
// point indices (so we can pass them to annReadTree())
// but we do not deallocate them. They will be deallocated
// when the tree is destroyed.
//------------------------------------------------------------------
if (strcmp(str, "tree") == 0) { // tree section
in >> the_dim; // read dimension
in >> the_n_pts; // number of points
in >> the_bkt_size; // bucket size
the_bnd_box_lo = annAllocPt(the_dim); // allocate bounding box pts
the_bnd_box_hi = annAllocPt(the_dim);
for (j = 0; j < the_dim; j++) { // read bounding box low
in >> the_bnd_box_lo[j];
}
for (j = 0; j < the_dim; j++) { // read bounding box low
in >> the_bnd_box_hi[j];
}
the_pidx = new ANNidx[the_n_pts]; // allocate point index array
int next_idx = 0; // number of indices filled
// read the tree and indices
the_root = annReadTree(in, tree_type, the_pidx, next_idx);
if (next_idx != the_n_pts) { // didn't see all the points?
annError("Didn't see as many points as expected", ANNwarn);
}
}
else {
annError("Illegal dump format. Expecting section heading", ANNabort);
}
return the_root;
}
//----------------------------------------------------------------------
// annReadTree - input tree and return pointer
//
// annReadTree reads in a node of the tree, makes any recursive
// calls as needed to input the children of this node (if internal).
// It returns a pointer to the node that was created. An array
// of point indices is given along with a pointer to the next
// available location in the array. As leaves are read, their
// point indices are stored here, and the point buckets point
// to the first entry in the array.
//
// Recall that these are the formats. The tree is given in
// preorder.
//
// Leaf node:
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
// Splitting nodes:
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
//
// For bd-trees:
//
// Shrinking nodes:
// shrink <n_bnds>
// <cut_dim> <cut_val> <side>
// <cut_dim> <cut_val> <side>
// ... (repeated n_bnds times)
//----------------------------------------------------------------------
static ANNkd_ptr annReadTree(
istream &in, // input stream
ANNtreeType tree_type, // type of tree expected
ANNidxArray the_pidx, // point indices (modified)
int &next_idx) // next index (modified)
{
char tag[STRING_LEN]; // tag (leaf, split, shrink)
int n_pts; // number of points in leaf
int cd; // cut dimension
ANNcoord cv; // cut value
ANNcoord lb; // low bound
ANNcoord hb; // high bound
int n_bnds; // number of bounding sides
int sd; // which side
in >> tag; // input node tag
if (strcmp(tag, "null") == 0) { // null tree
return NULL;
}
//------------------------------------------------------------------
// Read a leaf
//------------------------------------------------------------------
if (strcmp(tag, "leaf") == 0) { // leaf node
in >> n_pts; // input number of points
int old_idx = next_idx; // save next_idx
if (n_pts == 0) { // trivial leaf
return KD_TRIVIAL;
}
else {
for (int i = 0; i < n_pts; i++) { // input point indices
in >> the_pidx[next_idx++]; // store in array of indices
}
}
return new ANNkd_leaf(n_pts, &the_pidx[old_idx]);
}
//------------------------------------------------------------------
// Read a splitting node
//------------------------------------------------------------------
else if (strcmp(tag, "split") == 0) { // splitting node
in >> cd >> cv >> lb >> hb;
// read low and high subtrees
ANNkd_ptr lc = annReadTree(in, tree_type, the_pidx, next_idx);
ANNkd_ptr hc = annReadTree(in, tree_type, the_pidx, next_idx);
// create new node and return
return new ANNkd_split(cd, cv, lb, hb, lc, hc);
}
//------------------------------------------------------------------
// Read a shrinking node (bd-tree only)
//------------------------------------------------------------------
else if (strcmp(tag, "shrink") == 0) { // shrinking node
if (tree_type != BD_TREE) {
annError("Shrinking node not allowed in kd-tree", ANNabort);
}
in >> n_bnds; // number of bounding sides
// allocate bounds array
ANNorthHSArray bds = new ANNorthHalfSpace[n_bnds];
for (int i = 0; i < n_bnds; i++) {
in >> cd >> cv >> sd; // input bounding halfspace
// copy to array
bds[i] = ANNorthHalfSpace(cd, cv, sd);
}
// read inner and outer subtrees
ANNkd_ptr ic = annReadTree(in, tree_type, the_pidx, next_idx);
ANNkd_ptr oc = annReadTree(in, tree_type, the_pidx, next_idx);
// create new node and return
return new ANNbd_shrink(n_bnds, bds, ic, oc);
}
else {
annError("Illegal node type in dump file", ANNabort);
exit(0); // to keep the compiler happy
}
}
-183
View File
@@ -1,183 +0,0 @@
//----------------------------------------------------------------------
// File: kd_fix_rad_search.cpp
// Programmer: Sunil Arya and David Mount
// Description: Standard kd-tree fixed-radius kNN search
// Last modified: 05/03/05 (Version 1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 1.1 05/03/05
// Initial release
//----------------------------------------------------------------------
#include "kd_fix_rad_search.h" // kd fixed-radius search decls
//----------------------------------------------------------------------
// Approximate fixed-radius k nearest neighbor search
// The squared radius is provided, and this procedure finds the
// k nearest neighbors within the radius, and returns the total
// number of points lying within the radius.
//
// The method used for searching the kd-tree is a variation of the
// nearest neighbor search used in kd_search.cpp, except that the
// radius of the search ball is known. We refer the reader to that
// file for the explanation of the recursive search procedure.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// To keep argument lists short, a number of global variables
// are maintained which are common to all the recursive calls.
// These are given below.
//----------------------------------------------------------------------
int ANNkdFRDim; // dimension of space
ANNpoint ANNkdFRQ; // query point
ANNdist ANNkdFRSqRad; // squared radius search bound
double ANNkdFRMaxErr; // max tolerable squared error
ANNpointArray ANNkdFRPts; // the points
ANNmin_k* ANNkdFRPointMK; // set of k closest points
int ANNkdFRPtsVisited; // total points visited
int ANNkdFRPtsInRange; // number of points in the range
//----------------------------------------------------------------------
// annkFRSearch - fixed radius search for k nearest neighbors
//----------------------------------------------------------------------
int ANNkd_tree::annkFRSearch(
ANNpoint q, // the query point
ANNdist sqRad, // squared radius search bound
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor indices (returned)
ANNdistArray dd, // the approximate nearest neighbor
double eps) // the error bound
{
ANNkdFRDim = dim; // copy arguments to static equivs
ANNkdFRQ = q;
ANNkdFRSqRad = sqRad;
ANNkdFRPts = pts;
ANNkdFRPtsVisited = 0; // initialize count of points visited
ANNkdFRPtsInRange = 0; // ...and points in the range
ANNkdFRMaxErr = ANN_POW(1.0 + eps);
ANN_FLOP(2) // increment floating op count
ANNkdFRPointMK = new ANNmin_k(k); // create set for closest k points
// search starting at the root
root->ann_FR_search(annBoxDistance(q, bnd_box_lo, bnd_box_hi, dim));
for (int i = 0; i < k; i++) { // extract the k-th closest points
if (dd != NULL)
dd[i] = ANNkdFRPointMK->ith_smallest_key(i);
if (nn_idx != NULL)
nn_idx[i] = ANNkdFRPointMK->ith_smallest_info(i);
}
delete ANNkdFRPointMK; // deallocate closest point set
return ANNkdFRPtsInRange; // return final point count
}
//----------------------------------------------------------------------
// kd_split::ann_FR_search - search a splitting node
// Note: This routine is similar in structure to the standard kNN
// search. It visits the subtree that is closer to the query point
// first. For fixed-radius search, there is no benefit in visiting
// one subtree before the other, but we maintain the same basic
// code structure for the sake of uniformity.
//----------------------------------------------------------------------
void ANNkd_split::ann_FR_search(ANNdist box_dist)
{
// check dist calc term condition
if (ANNmaxPtsVisited != 0 && ANNkdFRPtsVisited > ANNmaxPtsVisited) return;
// distance to cutting plane
ANNcoord cut_diff = ANNkdFRQ[cut_dim] - cut_val;
if (cut_diff < 0) { // left of cutting plane
child[ANN_LO]->ann_FR_search(box_dist);// visit closer child first
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNkdFRQ[cut_dim];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
box_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
// visit further child if in range
if (box_dist * ANNkdFRMaxErr <= ANNkdFRSqRad)
child[ANN_HI]->ann_FR_search(box_dist);
}
else { // right of cutting plane
child[ANN_HI]->ann_FR_search(box_dist);// visit closer child first
ANNcoord box_diff = ANNkdFRQ[cut_dim] - cd_bnds[ANN_HI];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
box_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
// visit further child if close enough
if (box_dist * ANNkdFRMaxErr <= ANNkdFRSqRad)
child[ANN_LO]->ann_FR_search(box_dist);
}
ANN_FLOP(13) // increment floating ops
ANN_SPL(1) // one more splitting node visited
}
//----------------------------------------------------------------------
// kd_leaf::ann_FR_search - search points in a leaf node
// Note: The unreadability of this code is the result of
// some fine tuning to replace indexing by pointer operations.
//----------------------------------------------------------------------
void ANNkd_leaf::ann_FR_search(ANNdist box_dist)
{
register ANNdist dist; // distance to data point
register ANNcoord* pp; // data coordinate pointer
register ANNcoord* qq; // query coordinate pointer
register ANNcoord t;
register int d;
for (int i = 0; i < n_pts; i++) { // check points in bucket
pp = ANNkdFRPts[bkt[i]]; // first coord of next data point
qq = ANNkdFRQ; // first coord of query point
dist = 0;
for(d = 0; d < ANNkdFRDim; d++) {
ANN_COORD(1) // one more coordinate hit
ANN_FLOP(5) // increment floating ops
t = *(qq++) - *(pp++); // compute length and adv coordinate
// exceeds dist to k-th smallest?
if( (dist = ANN_SUM(dist, ANN_POW(t))) > ANNkdFRSqRad) {
break;
}
}
if (d >= ANNkdFRDim && // among the k best?
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
// add it to the list
ANNkdFRPointMK->insert(dist, bkt[i]);
ANNkdFRPtsInRange++; // increment point count
}
}
ANN_LEAF(1) // one more leaf node visited
ANN_PTS(n_pts) // increment points visited
ANNkdFRPtsVisited += n_pts; // increment number of points visited
}
-44
View File
@@ -1,44 +0,0 @@
//----------------------------------------------------------------------
// File: kd_fix_rad_search.h
// Programmer: Sunil Arya and David Mount
// Description: Standard kd-tree fixed-radius kNN search
// Last modified: 05/03/05 (Version 1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 1.1 05/03/05
// Initial release
//----------------------------------------------------------------------
#ifndef ANN_kd_fix_rad_search_H
#define ANN_kd_fix_rad_search_H
#include "kd_tree.h" // kd-tree declarations
#include "kd_util.h" // kd-tree utilities
#include "pr_queue_k.h" // k-element priority queue
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Global variables
// These are active for the life of each call to
// annRangeSearch(). They are set to save the number of
// variables that need to be passed among the various search
// procedures.
//----------------------------------------------------------------------
extern ANNpoint ANNkdFRQ; // query point (static copy)
#endif
-219
View File
@@ -1,219 +0,0 @@
//----------------------------------------------------------------------
// File: kd_pr_search.cpp
// Programmer: Sunil Arya and David Mount
// Description: Priority search for kd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#include "kd_pr_search.h" // kd priority search declarations
//----------------------------------------------------------------------
// Approximate nearest neighbor searching by priority search.
// The kd-tree is searched for an approximate nearest neighbor.
// The point is returned through one of the arguments, and the
// distance returned is the SQUARED distance to this point.
//
// The method used for searching the kd-tree is called priority
// search. (It is described in Arya and Mount, ``Algorithms for
// fast vector quantization,'' Proc. of DCC '93: Data Compression
// Conference}, eds. J. A. Storer and M. Cohn, IEEE Press, 1993,
// 381--390.)
//
// The cell of the kd-tree containing the query point is located,
// and cells are visited in increasing order of distance from the
// query point. This is done by placing each subtree which has
// NOT been visited in a priority queue, according to the closest
// distance of the corresponding enclosing rectangle from the
// query point. The search stops when the distance to the nearest
// remaining rectangle exceeds the distance to the nearest point
// seen by a factor of more than 1/(1+eps). (Implying that any
// point found subsequently in the search cannot be closer by more
// than this factor.)
//
// The main entry point is annkPriSearch() which sets things up and
// then call the recursive routine ann_pri_search(). This is a
// recursive routine which performs the processing for one node in
// the kd-tree. There are two versions of this virtual procedure,
// one for splitting nodes and one for leaves. When a splitting node
// is visited, we determine which child to continue the search on
// (the closer one), and insert the other child into the priority
// queue. When a leaf is visited, we compute the distances to the
// points in the buckets, and update information on the closest
// points.
//
// Some trickery is used to incrementally update the distance from
// a kd-tree rectangle to the query point. This comes about from
// the fact that which each successive split, only one component
// (along the dimension that is split) of the squared distance to
// the child rectangle is different from the squared distance to
// the parent rectangle.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// To keep argument lists short, a number of global variables
// are maintained which are common to all the recursive calls.
// These are given below.
//----------------------------------------------------------------------
double ANNprEps; // the error bound
int ANNprDim; // dimension of space
ANNpoint ANNprQ; // query point
double ANNprMaxErr; // max tolerable squared error
ANNpointArray ANNprPts; // the points
ANNpr_queue *ANNprBoxPQ; // priority queue for boxes
ANNmin_k *ANNprPointMK; // set of k closest points
//----------------------------------------------------------------------
// annkPriSearch - priority search for k nearest neighbors
//----------------------------------------------------------------------
void ANNkd_tree::annkPriSearch(
ANNpoint q, // query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor indices (returned)
ANNdistArray dd, // dist to near neighbors (returned)
double eps) // error bound (ignored)
{
// max tolerable squared error
ANNprMaxErr = ANN_POW(1.0 + eps);
ANN_FLOP(2) // increment floating ops
ANNprDim = dim; // copy arguments to static equivs
ANNprQ = q;
ANNprPts = pts;
ANNptsVisited = 0; // initialize count of points visited
ANNprPointMK = new ANNmin_k(k); // create set for closest k points
// distance to root box
ANNdist box_dist = annBoxDistance(q,
bnd_box_lo, bnd_box_hi, dim);
ANNprBoxPQ = new ANNpr_queue(n_pts);// create priority queue for boxes
ANNprBoxPQ->insert(box_dist, root); // insert root in priority queue
while (ANNprBoxPQ->non_empty() &&
(!(ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited))) {
ANNkd_ptr np; // next box from prior queue
// extract closest box from queue
ANNprBoxPQ->extr_min(box_dist, (void *&) np);
ANN_FLOP(2) // increment floating ops
if (box_dist*ANNprMaxErr >= ANNprPointMK->max_key())
break;
np->ann_pri_search(box_dist); // search this subtree.
}
for (int i = 0; i < k; i++) { // extract the k-th closest points
dd[i] = ANNprPointMK->ith_smallest_key(i);
nn_idx[i] = ANNprPointMK->ith_smallest_info(i);
}
delete ANNprPointMK; // deallocate closest point set
delete ANNprBoxPQ; // deallocate priority queue
}
//----------------------------------------------------------------------
// kd_split::ann_pri_search - search a splitting node
//----------------------------------------------------------------------
void ANNkd_split::ann_pri_search(ANNdist box_dist)
{
ANNdist new_dist; // distance to child visited later
// distance to cutting plane
ANNcoord cut_diff = ANNprQ[cut_dim] - cut_val;
if (cut_diff < 0) { // left of cutting plane
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNprQ[cut_dim];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
new_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
if (child[ANN_HI] != KD_TRIVIAL)// enqueue if not trivial
ANNprBoxPQ->insert(new_dist, child[ANN_HI]);
// continue with closer child
child[ANN_LO]->ann_pri_search(box_dist);
}
else { // right of cutting plane
ANNcoord box_diff = ANNprQ[cut_dim] - cd_bnds[ANN_HI];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
new_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
if (child[ANN_LO] != KD_TRIVIAL)// enqueue if not trivial
ANNprBoxPQ->insert(new_dist, child[ANN_LO]);
// continue with closer child
child[ANN_HI]->ann_pri_search(box_dist);
}
ANN_SPL(1) // one more splitting node visited
ANN_FLOP(8) // increment floating ops
}
//----------------------------------------------------------------------
// kd_leaf::ann_pri_search - search points in a leaf node
//
// This is virtually identical to the ann_search for standard search.
//----------------------------------------------------------------------
void ANNkd_leaf::ann_pri_search(ANNdist box_dist)
{
register ANNdist dist; // distance to data point
register ANNcoord* pp; // data coordinate pointer
register ANNcoord* qq; // query coordinate pointer
register ANNdist min_dist; // distance to k-th closest point
register ANNcoord t;
register int d;
min_dist = ANNprPointMK->max_key(); // k-th smallest distance so far
for (int i = 0; i < n_pts; i++) { // check points in bucket
pp = ANNprPts[bkt[i]]; // first coord of next data point
qq = ANNprQ; // first coord of query point
dist = 0;
for(d = 0; d < ANNprDim; d++) {
ANN_COORD(1) // one more coordinate hit
ANN_FLOP(4) // increment floating ops
t = *(qq++) - *(pp++); // compute length and adv coordinate
// exceeds dist to k-th smallest?
if( (dist = ANN_SUM(dist, ANN_POW(t))) > min_dist) {
break;
}
}
if (d >= ANNprDim && // among the k best?
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
// add it to the list
ANNprPointMK->insert(dist, bkt[i]);
min_dist = ANNprPointMK->max_key();
}
}
ANN_LEAF(1) // one more leaf node visited
ANN_PTS(n_pts) // increment points visited
ANNptsVisited += n_pts; // increment number of points visited
}
-49
View File
@@ -1,49 +0,0 @@
//----------------------------------------------------------------------
// File: kd_pr_search.h
// Programmer: Sunil Arya and David Mount
// Description: Priority kd-tree search
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef ANN_kd_pr_search_H
#define ANN_kd_pr_search_H
#include "kd_tree.h" // kd-tree declarations
#include "kd_util.h" // kd-tree utilities
#include "pr_queue.h" // priority queue declarations
#include "pr_queue_k.h" // k-element priority queue
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Global variables
// Active for the life of each call to Appx_Near_Neigh() or
// Appx_k_Near_Neigh().
//----------------------------------------------------------------------
extern double ANNprEps; // the error bound
extern int ANNprDim; // dimension of space
extern ANNpoint ANNprQ; // query point
extern double ANNprMaxErr; // max tolerable squared error
extern ANNpointArray ANNprPts; // the points
extern ANNpr_queue *ANNprBoxPQ; // priority queue for boxes
extern ANNmin_k *ANNprPointMK; // set of k closest points
#endif
-210
View File
@@ -1,210 +0,0 @@
//----------------------------------------------------------------------
// File: kd_search.cpp
// Programmer: Sunil Arya and David Mount
// Description: Standard kd-tree search
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Changed names LO, HI to ANN_LO, ANN_HI
//----------------------------------------------------------------------
#include "kd_search.h" // kd-search declarations
//----------------------------------------------------------------------
// Approximate nearest neighbor searching by kd-tree search
// The kd-tree is searched for an approximate nearest neighbor.
// The point is returned through one of the arguments, and the
// distance returned is the squared distance to this point.
//
// The method used for searching the kd-tree is an approximate
// adaptation of the search algorithm described by Friedman,
// Bentley, and Finkel, ``An algorithm for finding best matches
// in logarithmic expected time,'' ACM Transactions on Mathematical
// Software, 3(3):209-226, 1977).
//
// The algorithm operates recursively. When first encountering a
// node of the kd-tree we first visit the child which is closest to
// the query point. On return, we decide whether we want to visit
// the other child. If the box containing the other child exceeds
// 1/(1+eps) times the current best distance, then we skip it (since
// any point found in this child cannot be closer to the query point
// by more than this factor.) Otherwise, we visit it recursively.
// The distance between a box and the query point is computed exactly
// (not approximated as is often done in kd-tree), using incremental
// distance updates, as described by Arya and Mount in ``Algorithms
// for fast vector quantization,'' Proc. of DCC '93: Data Compression
// Conference, eds. J. A. Storer and M. Cohn, IEEE Press, 1993,
// 381-390.
//
// The main entry points is annkSearch() which sets things up and
// then call the recursive routine ann_search(). This is a recursive
// routine which performs the processing for one node in the kd-tree.
// There are two versions of this virtual procedure, one for splitting
// nodes and one for leaves. When a splitting node is visited, we
// determine which child to visit first (the closer one), and visit
// the other child on return. When a leaf is visited, we compute
// the distances to the points in the buckets, and update information
// on the closest points.
//
// Some trickery is used to incrementally update the distance from
// a kd-tree rectangle to the query point. This comes about from
// the fact that which each successive split, only one component
// (along the dimension that is split) of the squared distance to
// the child rectangle is different from the squared distance to
// the parent rectangle.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// To keep argument lists short, a number of global variables
// are maintained which are common to all the recursive calls.
// These are given below.
//----------------------------------------------------------------------
int ANNkdDim; // dimension of space
ANNpoint ANNkdQ; // query point
double ANNkdMaxErr; // max tolerable squared error
ANNpointArray ANNkdPts; // the points
ANNmin_k *ANNkdPointMK; // set of k closest points
//----------------------------------------------------------------------
// annkSearch - search for the k nearest neighbors
//----------------------------------------------------------------------
void ANNkd_tree::annkSearch(
ANNpoint q, // the query point
int k, // number of near neighbors to return
ANNidxArray nn_idx, // nearest neighbor indices (returned)
ANNdistArray dd, // the approximate nearest neighbor
double eps) // the error bound
{
ANNkdDim = dim; // copy arguments to static equivs
ANNkdQ = q;
ANNkdPts = pts;
ANNptsVisited = 0; // initialize count of points visited
if (k > n_pts) { // too many near neighbors?
annError("Requesting more near neighbors than data points", ANNabort);
}
ANNkdMaxErr = ANN_POW(1.0 + eps);
ANN_FLOP(2) // increment floating op count
ANNkdPointMK = new ANNmin_k(k); // create set for closest k points
// search starting at the root
root->ann_search(annBoxDistance(q, bnd_box_lo, bnd_box_hi, dim));
for (int i = 0; i < k; i++) { // extract the k-th closest points
dd[i] = ANNkdPointMK->ith_smallest_key(i);
nn_idx[i] = ANNkdPointMK->ith_smallest_info(i);
}
delete ANNkdPointMK; // deallocate closest point set
}
//----------------------------------------------------------------------
// kd_split::ann_search - search a splitting node
//----------------------------------------------------------------------
void ANNkd_split::ann_search(ANNdist box_dist)
{
// check dist calc term condition
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
// distance to cutting plane
ANNcoord cut_diff = ANNkdQ[cut_dim] - cut_val;
if (cut_diff < 0) { // left of cutting plane
child[ANN_LO]->ann_search(box_dist);// visit closer child first
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNkdQ[cut_dim];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
box_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
// visit further child if close enough
if (box_dist * ANNkdMaxErr < ANNkdPointMK->max_key())
child[ANN_HI]->ann_search(box_dist);
}
else { // right of cutting plane
child[ANN_HI]->ann_search(box_dist);// visit closer child first
ANNcoord box_diff = ANNkdQ[cut_dim] - cd_bnds[ANN_HI];
if (box_diff < 0) // within bounds - ignore
box_diff = 0;
// distance to further box
box_dist = (ANNdist) ANN_SUM(box_dist,
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
// visit further child if close enough
if (box_dist * ANNkdMaxErr < ANNkdPointMK->max_key())
child[ANN_LO]->ann_search(box_dist);
}
ANN_FLOP(10) // increment floating ops
ANN_SPL(1) // one more splitting node visited
}
//----------------------------------------------------------------------
// kd_leaf::ann_search - search points in a leaf node
// Note: The unreadability of this code is the result of
// some fine tuning to replace indexing by pointer operations.
//----------------------------------------------------------------------
void ANNkd_leaf::ann_search(ANNdist box_dist)
{
register ANNdist dist; // distance to data point
register ANNcoord* pp; // data coordinate pointer
register ANNcoord* qq; // query coordinate pointer
register ANNdist min_dist; // distance to k-th closest point
register ANNcoord t;
register int d;
min_dist = ANNkdPointMK->max_key(); // k-th smallest distance so far
for (int i = 0; i < n_pts; i++) { // check points in bucket
pp = ANNkdPts[bkt[i]]; // first coord of next data point
qq = ANNkdQ; // first coord of query point
dist = 0;
for(d = 0; d < ANNkdDim; d++) {
ANN_COORD(1) // one more coordinate hit
ANN_FLOP(4) // increment floating ops
t = *(qq++) - *(pp++); // compute length and adv coordinate
// exceeds dist to k-th smallest?
if( (dist = ANN_SUM(dist, ANN_POW(t))) > min_dist) {
break;
}
}
if (d >= ANNkdDim && // among the k best?
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
// add it to the list
ANNkdPointMK->insert(dist, bkt[i]);
min_dist = ANNkdPointMK->max_key();
}
}
ANN_LEAF(1) // one more leaf node visited
ANN_PTS(n_pts) // increment points visited
ANNptsVisited += n_pts; // increment number of points visited
}
-48
View File
@@ -1,48 +0,0 @@
//----------------------------------------------------------------------
// File: kd_search.h
// Programmer: Sunil Arya and David Mount
// Description: Standard kd-tree search
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef ANN_kd_search_H
#define ANN_kd_search_H
#include "kd_tree.h" // kd-tree declarations
#include "kd_util.h" // kd-tree utilities
#include "pr_queue_k.h" // k-element priority queue
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// More global variables
// These are active for the life of each call to annkSearch(). They
// are set to save the number of variables that need to be passed
// among the various search procedures.
//----------------------------------------------------------------------
extern int ANNkdDim; // dimension of space (static copy)
extern ANNpoint ANNkdQ; // query point (static copy)
extern double ANNkdMaxErr; // max tolerable squared error
extern ANNpointArray ANNkdPts; // the points (static copy)
extern ANNmin_k *ANNkdPointMK; // set of k closest points
extern int ANNptsVisited; // number of points visited
#endif
-428
View File
@@ -1,428 +0,0 @@
//----------------------------------------------------------------------
// File: kd_split.cpp
// Programmer: Sunil Arya and David Mount
// Description: Methods for splitting kd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
//----------------------------------------------------------------------
#include "kd_tree.h" // kd-tree definitions
#include "kd_util.h" // kd-tree utilities
#include "kd_split.h" // splitting functions
//----------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------
const double ERR = 0.001; // a small value
const double FS_ASPECT_RATIO = 3.0; // maximum allowed aspect ratio
// in fair split. Must be >= 2.
//----------------------------------------------------------------------
// kd_split - Bentley's standard splitting routine for kd-trees
// Find the dimension of the greatest spread, and split
// just before the median point along this dimension.
//----------------------------------------------------------------------
void kd_split(
ANNpointArray pa, // point array (permuted on return)
ANNidxArray pidx, // point indices
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo) // num of points on low side (returned)
{
// find dimension of maximum spread
cut_dim = annMaxSpread(pa, pidx, n, dim);
n_lo = n/2; // median rank
// split about median
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
}
//----------------------------------------------------------------------
// midpt_split - midpoint splitting rule for box-decomposition trees
//
// This is the simplest splitting rule that guarantees boxes
// of bounded aspect ratio. It simply cuts the box with the
// longest side through its midpoint. If there are ties, it
// selects the dimension with the maximum point spread.
//
// WARNING: This routine (while simple) doesn't seem to work
// well in practice in high dimensions, because it tends to
// generate a large number of trivial and/or unbalanced splits.
// Either kd_split(), sl_midpt_split(), or fair_split() are
// recommended, instead.
//----------------------------------------------------------------------
void midpt_split(
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo) // num of points on low side (returned)
{
int d;
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
for (d = 1; d < dim; d++) { // find length of longest box side
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (length > max_length) {
max_length = length;
}
}
ANNcoord max_spread = -1; // find long side with most spread
for (d = 0; d < dim; d++) {
// is it among longest?
if (double(bnds.hi[d] - bnds.lo[d]) >= (1-ERR)*max_length) {
// compute its spread
ANNcoord spr = annSpread(pa, pidx, n, d);
if (spr > max_spread) { // is it max so far?
max_spread = spr;
cut_dim = d;
}
}
}
// split along cut_dim at midpoint
cut_val = (bnds.lo[cut_dim] + bnds.hi[cut_dim]) / 2;
// permute points accordingly
int br1, br2;
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
//------------------------------------------------------------------
// On return: pa[0..br1-1] < cut_val
// pa[br1..br2-1] == cut_val
// pa[br2..n-1] > cut_val
//
// We can set n_lo to any value in the range [br1..br2].
// We choose split so that points are most evenly divided.
//------------------------------------------------------------------
if (br1 > n/2) n_lo = br1;
else if (br2 < n/2) n_lo = br2;
else n_lo = n/2;
}
//----------------------------------------------------------------------
// sl_midpt_split - sliding midpoint splitting rule
//
// This is a modification of midpt_split, which has the nonsensical
// name "sliding midpoint". The idea is that we try to use the
// midpoint rule, by bisecting the longest side. If there are
// ties, the dimension with the maximum spread is selected. If,
// however, the midpoint split produces a trivial split (no points
// on one side of the splitting plane) then we slide the splitting
// (maintaining its orientation) until it produces a nontrivial
// split. For example, if the splitting plane is along the x-axis,
// and all the data points have x-coordinate less than the x-bisector,
// then the split is taken along the maximum x-coordinate of the
// data points.
//
// Intuitively, this rule cannot generate trivial splits, and
// hence avoids midpt_split's tendency to produce trees with
// a very large number of nodes.
//
//----------------------------------------------------------------------
void sl_midpt_split(
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo) // num of points on low side (returned)
{
int d;
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
for (d = 1; d < dim; d++) { // find length of longest box side
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (length > max_length) {
max_length = length;
}
}
ANNcoord max_spread = -1; // find long side with most spread
for (d = 0; d < dim; d++) {
// is it among longest?
if ((bnds.hi[d] - bnds.lo[d]) >= (1-ERR)*max_length) {
// compute its spread
ANNcoord spr = annSpread(pa, pidx, n, d);
if (spr > max_spread) { // is it max so far?
max_spread = spr;
cut_dim = d;
}
}
}
// ideal split at midpoint
ANNcoord ideal_cut_val = (bnds.lo[cut_dim] + bnds.hi[cut_dim])/2;
ANNcoord min, max;
annMinMax(pa, pidx, n, cut_dim, min, max); // find min/max coordinates
if (ideal_cut_val < min) // slide to min or max as needed
cut_val = min;
else if (ideal_cut_val > max)
cut_val = max;
else
cut_val = ideal_cut_val;
// permute points accordingly
int br1, br2;
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
//------------------------------------------------------------------
// On return: pa[0..br1-1] < cut_val
// pa[br1..br2-1] == cut_val
// pa[br2..n-1] > cut_val
//
// We can set n_lo to any value in the range [br1..br2] to satisfy
// the exit conditions of the procedure.
//
// if ideal_cut_val < min (implying br2 >= 1),
// then we select n_lo = 1 (so there is one point on left) and
// if ideal_cut_val > max (implying br1 <= n-1),
// then we select n_lo = n-1 (so there is one point on right).
// Otherwise, we select n_lo as close to n/2 as possible within
// [br1..br2].
//------------------------------------------------------------------
if (ideal_cut_val < min) n_lo = 1;
else if (ideal_cut_val > max) n_lo = n-1;
else if (br1 > n/2) n_lo = br1;
else if (br2 < n/2) n_lo = br2;
else n_lo = n/2;
}
//----------------------------------------------------------------------
// fair_split - fair-split splitting rule
//
// This is a compromise between the kd-tree splitting rule (which
// always splits data points at their median) and the midpoint
// splitting rule (which always splits a box through its center.
// The goal of this procedure is to achieve both nicely balanced
// splits, and boxes of bounded aspect ratio.
//
// A constant FS_ASPECT_RATIO is defined. Given a box, those sides
// which can be split so that the ratio of the longest to shortest
// side does not exceed ASPECT_RATIO are identified. Among these
// sides, we select the one in which the points have the largest
// spread. We then split the points in a manner which most evenly
// distributes the points on either side of the splitting plane,
// subject to maintaining the bound on the ratio of long to short
// sides. To determine that the aspect ratio will be preserved,
// we determine the longest side (other than this side), and
// determine how narrowly we can cut this side, without causing the
// aspect ratio bound to be exceeded (small_piece).
//
// This procedure is more robust than either kd_split or midpt_split,
// but is more complicated as well. When point distribution is
// extremely skewed, this degenerates to midpt_split (actually
// 1/3 point split), and when the points are most evenly distributed,
// this degenerates to kd-split.
//----------------------------------------------------------------------
void fair_split(
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo) // num of points on low side (returned)
{
int d;
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
cut_dim = 0;
for (d = 1; d < dim; d++) { // find length of longest box side
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (length > max_length) {
max_length = length;
cut_dim = d;
}
}
ANNcoord max_spread = 0; // find legal cut with max spread
cut_dim = 0;
for (d = 0; d < dim; d++) {
ANNcoord length = bnds.hi[d] - bnds.lo[d];
// is this side midpoint splitable
// without violating aspect ratio?
if (((double) max_length)*2.0/((double) length) <= FS_ASPECT_RATIO) {
// compute spread along this dim
ANNcoord spr = annSpread(pa, pidx, n, d);
if (spr > max_spread) { // best spread so far
max_spread = spr;
cut_dim = d; // this is dimension to cut
}
}
}
max_length = 0; // find longest side other than cut_dim
for (d = 0; d < dim; d++) {
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (d != cut_dim && length > max_length)
max_length = length;
}
// consider most extreme splits
ANNcoord small_piece = max_length / FS_ASPECT_RATIO;
ANNcoord lo_cut = bnds.lo[cut_dim] + small_piece;// lowest legal cut
ANNcoord hi_cut = bnds.hi[cut_dim] - small_piece;// highest legal cut
int br1, br2;
// is median below lo_cut ?
if (annSplitBalance(pa, pidx, n, cut_dim, lo_cut) >= 0) {
cut_val = lo_cut; // cut at lo_cut
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = br1;
}
// is median above hi_cut?
else if (annSplitBalance(pa, pidx, n, cut_dim, hi_cut) <= 0) {
cut_val = hi_cut; // cut at hi_cut
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = br2;
}
else { // median cut preserves asp ratio
n_lo = n/2; // split about median
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
}
}
//----------------------------------------------------------------------
// sl_fair_split - sliding fair split splitting rule
//
// Sliding fair split is a splitting rule that combines the
// strengths of both fair split with sliding midpoint split.
// Fair split tends to produce balanced splits when the points
// are roughly uniformly distributed, but it can produce many
// trivial splits when points are highly clustered. Sliding
// midpoint never produces trivial splits, and shrinks boxes
// nicely if points are highly clustered, but it may produce
// rather unbalanced splits when points are unclustered but not
// quite uniform.
//
// Sliding fair split is based on the theory that there are two
// types of splits that are "good": balanced splits that produce
// fat boxes, and unbalanced splits provided the cell with fewer
// points is fat.
//
// This splitting rule operates by first computing the longest
// side of the current bounding box. Then it asks which sides
// could be split (at the midpoint) and still satisfy the aspect
// ratio bound with respect to this side. Among these, it selects
// the side with the largest spread (as fair split would). It
// then considers the most extreme cuts that would be allowed by
// the aspect ratio bound. This is done by dividing the longest
// side of the box by the aspect ratio bound. If the median cut
// lies between these extreme cuts, then we use the median cut.
// If not, then consider the extreme cut that is closer to the
// median. If all the points lie to one side of this cut, then
// we slide the cut until it hits the first point. This may
// violate the aspect ratio bound, but will never generate empty
// cells. However the sibling of every such skinny cell is fat,
// and hence packing arguments still apply.
//
//----------------------------------------------------------------------
void sl_fair_split(
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo) // num of points on low side (returned)
{
int d;
ANNcoord min, max; // min/max coordinates
int br1, br2; // split break points
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
cut_dim = 0;
for (d = 1; d < dim; d++) { // find length of longest box side
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (length > max_length) {
max_length = length;
cut_dim = d;
}
}
ANNcoord max_spread = 0; // find legal cut with max spread
cut_dim = 0;
for (d = 0; d < dim; d++) {
ANNcoord length = bnds.hi[d] - bnds.lo[d];
// is this side midpoint splitable
// without violating aspect ratio?
if (((double) max_length)*2.0/((double) length) <= FS_ASPECT_RATIO) {
// compute spread along this dim
ANNcoord spr = annSpread(pa, pidx, n, d);
if (spr > max_spread) { // best spread so far
max_spread = spr;
cut_dim = d; // this is dimension to cut
}
}
}
max_length = 0; // find longest side other than cut_dim
for (d = 0; d < dim; d++) {
ANNcoord length = bnds.hi[d] - bnds.lo[d];
if (d != cut_dim && length > max_length)
max_length = length;
}
// consider most extreme splits
ANNcoord small_piece = max_length / FS_ASPECT_RATIO;
ANNcoord lo_cut = bnds.lo[cut_dim] + small_piece;// lowest legal cut
ANNcoord hi_cut = bnds.hi[cut_dim] - small_piece;// highest legal cut
// find min and max along cut_dim
annMinMax(pa, pidx, n, cut_dim, min, max);
// is median below lo_cut?
if (annSplitBalance(pa, pidx, n, cut_dim, lo_cut) >= 0) {
if (max > lo_cut) { // are any points above lo_cut?
cut_val = lo_cut; // cut at lo_cut
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = br1; // balance if there are ties
}
else { // all points below lo_cut
cut_val = max; // cut at max value
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = n-1;
}
}
// is median above hi_cut?
else if (annSplitBalance(pa, pidx, n, cut_dim, hi_cut) <= 0) {
if (min < hi_cut) { // are any points below hi_cut?
cut_val = hi_cut; // cut at hi_cut
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = br2; // balance if there are ties
}
else { // all points above hi_cut
cut_val = min; // cut at min value
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
n_lo = 1;
}
}
else { // median cut is good enough
n_lo = n/2; // split about median
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
}
}
-85
View File
@@ -1,85 +0,0 @@
//----------------------------------------------------------------------
// File: kd_split.h
// Programmer: Sunil Arya and David Mount
// Description: Methods for splitting kd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef ANN_KD_SPLIT_H
#define ANN_KD_SPLIT_H
#include "kd_tree.h" // kd-tree definitions
//----------------------------------------------------------------------
// External entry points
// These are all splitting procedures for kd-trees.
//----------------------------------------------------------------------
void kd_split( // standard (optimized) kd-splitter
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
void midpt_split( // midpoint kd-splitter
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
void sl_midpt_split( // sliding midpoint kd-splitter
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
void fair_split( // fair-split kd-splitter
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
void sl_fair_split( // sliding fair-split kd-splitter
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
#endif
-405
View File
@@ -1,405 +0,0 @@
//----------------------------------------------------------------------
// File: kd_tree.cpp
// Programmer: Sunil Arya and David Mount
// Description: Basic methods for kd-trees.
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Increased aspect ratio bound (ANN_AR_TOOBIG) from 100 to 1000.
// Fixed leaf counts to count trivial leaves.
// Added optional pa, pi arguments to Skeleton kd_tree constructor
// for use in load constructor.
// Added annClose() to eliminate KD_TRIVIAL memory leak.
//----------------------------------------------------------------------
#include "kd_tree.h" // kd-tree declarations
#include "kd_split.h" // kd-tree splitting rules
#include "kd_util.h" // kd-tree utilities
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Global data
//
// For some splitting rules, especially with small bucket sizes,
// it is possible to generate a large number of empty leaf nodes.
// To save storage we allocate a single trivial leaf node which
// contains no points. For messy coding reasons it is convenient
// to have it reference a trivial point index.
//
// KD_TRIVIAL is allocated when the first kd-tree is created. It
// must *never* deallocated (since it may be shared by more than
// one tree).
//----------------------------------------------------------------------
static int IDX_TRIVIAL[] = {0}; // trivial point index
ANNkd_leaf *KD_TRIVIAL = NULL; // trivial leaf node
//----------------------------------------------------------------------
// Printing the kd-tree
// These routines print a kd-tree in reverse inorder (high then
// root then low). (This is so that if you look at the output
// from the right side it appear from left to right in standard
// inorder.) When outputting leaves we output only the point
// indices rather than the point coordinates. There is an option
// to print the point coordinates separately.
//
// The tree printing routine calls the printing routines on the
// individual nodes of the tree, passing in the level or depth
// in the tree. The level in the tree is used to print indentation
// for readability.
//----------------------------------------------------------------------
void ANNkd_split::print( // print splitting node
int level, // depth of node in tree
ostream &out) // output stream
{
child[ANN_HI]->print(level+1, out); // print high child
out << " ";
for (int i = 0; i < level; i++) // print indentation
out << "..";
out << "Split cd=" << cut_dim << " cv=" << cut_val;
out << " lbnd=" << cd_bnds[ANN_LO];
out << " hbnd=" << cd_bnds[ANN_HI];
out << "\n";
child[ANN_LO]->print(level+1, out); // print low child
}
void ANNkd_leaf::print( // print leaf node
int level, // depth of node in tree
ostream &out) // output stream
{
out << " ";
for (int i = 0; i < level; i++) // print indentation
out << "..";
if (this == KD_TRIVIAL) { // canonical trivial leaf node
out << "Leaf (trivial)\n";
}
else{
out << "Leaf n=" << n_pts << " <";
for (int j = 0; j < n_pts; j++) {
out << bkt[j];
if (j < n_pts-1) out << ",";
}
out << ">\n";
}
}
void ANNkd_tree::Print( // print entire tree
ANNbool with_pts, // print points as well?
ostream &out) // output stream
{
out << "ANN Version " << ANNversion << "\n";
if (with_pts) { // print point coordinates
out << " Points:\n";
for (int i = 0; i < n_pts; i++) {
out << "\t" << i << ": ";
annPrintPt(pts[i], dim, out);
out << "\n";
}
}
if (root == NULL) // empty tree?
out << " Null tree.\n";
else {
root->print(0, out); // invoke printing at root
}
}
//----------------------------------------------------------------------
// kd_tree statistics (for performance evaluation)
// This routine compute various statistics information for
// a kd-tree. It is used by the implementors for performance
// evaluation of the data structure.
//----------------------------------------------------------------------
#define MAX(a,b) ((a) > (b) ? (a) : (b))
void ANNkdStats::merge(const ANNkdStats &st) // merge stats from child
{
n_lf += st.n_lf; n_tl += st.n_tl;
n_spl += st.n_spl; n_shr += st.n_shr;
depth = MAX(depth, st.depth);
sum_ar += st.sum_ar;
}
//----------------------------------------------------------------------
// Update statistics for nodes
//----------------------------------------------------------------------
const double ANN_AR_TOOBIG = 1000; // too big an aspect ratio
void ANNkd_leaf::getStats( // get subtree statistics
int dim, // dimension of space
ANNkdStats &st, // stats (modified)
ANNorthRect &bnd_box) // bounding box
{
st.reset();
st.n_lf = 1; // count this leaf
if (this == KD_TRIVIAL) st.n_tl = 1; // count trivial leaf
double ar = annAspectRatio(dim, bnd_box); // aspect ratio of leaf
// incr sum (ignore outliers)
st.sum_ar += float(ar < ANN_AR_TOOBIG ? ar : ANN_AR_TOOBIG);
}
void ANNkd_split::getStats( // get subtree statistics
int dim, // dimension of space
ANNkdStats &st, // stats (modified)
ANNorthRect &bnd_box) // bounding box
{
ANNkdStats ch_stats; // stats for children
// get stats for low child
ANNcoord hv = bnd_box.hi[cut_dim]; // save box bounds
bnd_box.hi[cut_dim] = cut_val; // upper bound for low child
ch_stats.reset(); // reset
child[ANN_LO]->getStats(dim, ch_stats, bnd_box);
st.merge(ch_stats); // merge them
bnd_box.hi[cut_dim] = hv; // restore bound
// get stats for high child
ANNcoord lv = bnd_box.lo[cut_dim]; // save box bounds
bnd_box.lo[cut_dim] = cut_val; // lower bound for high child
ch_stats.reset(); // reset
child[ANN_HI]->getStats(dim, ch_stats, bnd_box);
st.merge(ch_stats); // merge them
bnd_box.lo[cut_dim] = lv; // restore bound
st.depth++; // increment depth
st.n_spl++; // increment number of splits
}
//----------------------------------------------------------------------
// getStats
// Collects a number of statistics related to kd_tree or
// bd_tree.
//----------------------------------------------------------------------
void ANNkd_tree::getStats( // get tree statistics
ANNkdStats &st) // stats (modified)
{
st.reset(dim, n_pts, bkt_size); // reset stats
// create bounding box
ANNorthRect bnd_box(dim, bnd_box_lo, bnd_box_hi);
if (root != NULL) { // if nonempty tree
root->getStats(dim, st, bnd_box); // get statistics
st.avg_ar = st.sum_ar / st.n_lf; // average leaf asp ratio
}
}
//----------------------------------------------------------------------
// kd_tree destructor
// The destructor just frees the various elements that were
// allocated in the construction process.
//----------------------------------------------------------------------
ANNkd_tree::~ANNkd_tree() // tree destructor
{
if (root != NULL) delete root;
if (pidx != NULL) delete [] pidx;
if (bnd_box_lo != NULL) annDeallocPt(bnd_box_lo);
if (bnd_box_hi != NULL) annDeallocPt(bnd_box_hi);
}
//----------------------------------------------------------------------
// This is called with all use of ANN is finished. It eliminates the
// minor memory leak caused by the allocation of KD_TRIVIAL.
//----------------------------------------------------------------------
void annClose() // close use of ANN
{
if (KD_TRIVIAL != NULL) {
delete KD_TRIVIAL;
KD_TRIVIAL = NULL;
}
}
//----------------------------------------------------------------------
// kd_tree constructors
// There is a skeleton kd-tree constructor which sets up a
// trivial empty tree. The last optional argument allows
// the routine to be passed a point index array which is
// assumed to be of the proper size (n). Otherwise, one is
// allocated and initialized to the identity. Warning: In
// either case the destructor will deallocate this array.
//
// As a kludge, we need to allocate KD_TRIVIAL if one has not
// already been allocated. (This is because I'm too dumb to
// figure out how to cause a pointer to be allocated at load
// time.)
//----------------------------------------------------------------------
void ANNkd_tree::SkeletonTree( // construct skeleton tree
int n, // number of points
int dd, // dimension
int bs, // bucket size
ANNpointArray pa, // point array
ANNidxArray pi) // point indices
{
dim = dd; // initialize basic elements
n_pts = n;
bkt_size = bs;
pts = pa; // initialize points array
root = NULL; // no associated tree yet
if (pi == NULL) { // point indices provided?
pidx = new ANNidx[n]; // no, allocate space for point indices
for (int i = 0; i < n; i++) {
pidx[i] = i; // initially identity
}
}
else {
pidx = pi; // yes, use them
}
bnd_box_lo = bnd_box_hi = NULL; // bounding box is nonexistent
if (KD_TRIVIAL == NULL) // no trivial leaf node yet?
KD_TRIVIAL = new ANNkd_leaf(0, IDX_TRIVIAL); // allocate it
}
ANNkd_tree::ANNkd_tree( // basic constructor
int n, // number of points
int dd, // dimension
int bs) // bucket size
{ SkeletonTree(n, dd, bs); } // construct skeleton tree
//----------------------------------------------------------------------
// rkd_tree - recursive procedure to build a kd-tree
//
// Builds a kd-tree for points in pa as indexed through the
// array pidx[0..n-1] (typically a subarray of the array used in
// the top-level call). This routine permutes the array pidx,
// but does not alter pa[].
//
// The construction is based on a standard algorithm for constructing
// the kd-tree (see Friedman, Bentley, and Finkel, ``An algorithm for
// finding best matches in logarithmic expected time,'' ACM Transactions
// on Mathematical Software, 3(3):209-226, 1977). The procedure
// operates by a simple divide-and-conquer strategy, which determines
// an appropriate orthogonal cutting plane (see below), and splits
// the points. When the number of points falls below the bucket size,
// we simply store the points in a leaf node's bucket.
//
// One of the arguments is a pointer to a splitting routine,
// whose prototype is:
//
// void split(
// ANNpointArray pa, // complete point array
// ANNidxArray pidx, // point array (permuted on return)
// ANNorthRect &bnds, // bounds of current cell
// int n, // number of points
// int dim, // dimension of space
// int &cut_dim, // cutting dimension
// ANNcoord &cut_val, // cutting value
// int &n_lo) // no. of points on low side of cut
//
// This procedure selects a cutting dimension and cutting value,
// partitions pa about these values, and returns the number of
// points on the low side of the cut.
//----------------------------------------------------------------------
ANNkd_ptr rkd_tree( // recursive construction of kd-tree
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
int bsp, // bucket space
ANNorthRect &bnd_box, // bounding box for current node
ANNkd_splitter splitter) // splitting routine
{
if (n <= bsp) { // n small, make a leaf node
if (n == 0) // empty leaf node
return KD_TRIVIAL; // return (canonical) empty leaf
else // construct the node and return
return new ANNkd_leaf(n, pidx);
}
else { // n large, make a splitting node
int cd; // cutting dimension
ANNcoord cv; // cutting value
int n_lo; // number on low side of cut
ANNkd_node *lo, *hi; // low and high children
// invoke splitting procedure
(*splitter)(pa, pidx, bnd_box, n, dim, cd, cv, n_lo);
ANNcoord lv = bnd_box.lo[cd]; // save bounds for cutting dimension
ANNcoord hv = bnd_box.hi[cd];
bnd_box.hi[cd] = cv; // modify bounds for left subtree
lo = rkd_tree( // build left subtree
pa, pidx, n_lo, // ...from pidx[0..n_lo-1]
dim, bsp, bnd_box, splitter);
bnd_box.hi[cd] = hv; // restore bounds
bnd_box.lo[cd] = cv; // modify bounds for right subtree
hi = rkd_tree( // build right subtree
pa, pidx + n_lo, n-n_lo,// ...from pidx[n_lo..n-1]
dim, bsp, bnd_box, splitter);
bnd_box.lo[cd] = lv; // restore bounds
// create the splitting node
ANNkd_split *ptr = new ANNkd_split(cd, cv, lv, hv, lo, hi);
return ptr; // return pointer to this node
}
}
//----------------------------------------------------------------------
// kd-tree constructor
// This is the main constructor for kd-trees given a set of points.
// It first builds a skeleton tree, then computes the bounding box
// of the data points, and then invokes rkd_tree() to actually
// build the tree, passing it the appropriate splitting routine.
//----------------------------------------------------------------------
ANNkd_tree::ANNkd_tree( // construct from point array
ANNpointArray pa, // point array (with at least n pts)
int n, // number of points
int dd, // dimension
int bs, // bucket size
ANNsplitRule split) // splitting method
{
SkeletonTree(n, dd, bs); // set up the basic stuff
pts = pa; // where the points are
if (n == 0) return; // no points--no sweat
ANNorthRect bnd_box(dd); // bounding box for points
annEnclRect(pa, pidx, n, dd, bnd_box);// construct bounding rectangle
// copy to tree structure
bnd_box_lo = annCopyPt(dd, bnd_box.lo);
bnd_box_hi = annCopyPt(dd, bnd_box.hi);
switch (split) { // build by rule
case ANN_KD_STD: // standard kd-splitting rule
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split);
break;
case ANN_KD_MIDPT: // midpoint split
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split);
break;
case ANN_KD_FAIR: // fair split
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split);
break;
case ANN_KD_SUGGEST: // best (in our opinion)
case ANN_KD_SL_MIDPT: // sliding midpoint split
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split);
break;
case ANN_KD_SL_FAIR: // sliding fair split
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, sl_fair_split);
break;
default:
annError("Illegal splitting method", ANNabort);
}
}
-197
View File
@@ -1,197 +0,0 @@
//----------------------------------------------------------------------
// File: kd_tree.h
// Programmer: Sunil Arya and David Mount
// Description: Declarations for standard kd-tree routines
// Last modified: 05/03/05 (Version 1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.1 05/03/05
// Added fixed radius kNN search
//----------------------------------------------------------------------
#ifndef ANN_kd_tree_H
#define ANN_kd_tree_H
#include <ANN/ANNx.h> // all ANN includes
using namespace std; // make std:: available
//----------------------------------------------------------------------
// Generic kd-tree node
//
// Nodes in kd-trees are of two types, splitting nodes which contain
// splitting information (a splitting hyperplane orthogonal to one
// of the coordinate axes) and leaf nodes which contain point
// information (an array of points stored in a bucket). This is
// handled by making a generic class kd_node, which is essentially an
// empty shell, and then deriving the leaf and splitting nodes from
// this.
//----------------------------------------------------------------------
class ANNkd_node{ // generic kd-tree node (empty shell)
public:
virtual ~ANNkd_node() {} // virtual distroyer
virtual void ann_search(ANNdist) = 0; // tree search
virtual void ann_pri_search(ANNdist) = 0; // priority search
virtual void ann_FR_search(ANNdist) = 0; // fixed-radius search
virtual void getStats( // get tree statistics
int dim, // dimension of space
ANNkdStats &st, // statistics
ANNorthRect &bnd_box) = 0; // bounding box
// print node
virtual void print(int level, ostream &out) = 0;
virtual void dump(ostream &out) = 0; // dump node
friend class ANNkd_tree; // allow kd-tree to access us
};
//----------------------------------------------------------------------
// kd-splitting function:
// kd_splitter is a pointer to a splitting routine for preprocessing.
// Different splitting procedures result in different strategies
// for building the tree.
//----------------------------------------------------------------------
typedef void (*ANNkd_splitter)( // splitting routine for kd-trees
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices (permuted on return)
const ANNorthRect &bnds, // bounding rectangle for cell
int n, // number of points
int dim, // dimension of space
int &cut_dim, // cutting dimension (returned)
ANNcoord &cut_val, // cutting value (returned)
int &n_lo); // num of points on low side (returned)
//----------------------------------------------------------------------
// Leaf kd-tree node
// Leaf nodes of the kd-tree store the set of points associated
// with this bucket, stored as an array of point indices. These
// are indices in the array points, which resides with the
// root of the kd-tree. We also store the number of points
// that reside in this bucket.
//----------------------------------------------------------------------
class ANNkd_leaf: public ANNkd_node // leaf node for kd-tree
{
int n_pts; // no. points in bucket
ANNidxArray bkt; // bucket of points
public:
ANNkd_leaf( // constructor
int n, // number of points
ANNidxArray b) // bucket
{
n_pts = n; // number of points in bucket
bkt = b; // the bucket
}
~ANNkd_leaf() { } // destructor (none)
virtual void getStats( // get tree statistics
int dim, // dimension of space
ANNkdStats &st, // statistics
ANNorthRect &bnd_box); // bounding box
virtual void print(int level, ostream &out);// print node
virtual void dump(ostream &out); // dump node
virtual void ann_search(ANNdist); // standard search
virtual void ann_pri_search(ANNdist); // priority search
virtual void ann_FR_search(ANNdist); // fixed-radius search
};
//----------------------------------------------------------------------
// KD_TRIVIAL is a special pointer to an empty leaf node. Since
// some splitting rules generate many (more than 50%) trivial
// leaves, we use this one shared node to save space.
//
// The pointer is initialized to NULL, but whenever a kd-tree is
// created, we allocate this node, if it has not already been
// allocated. This node is *never* deallocated, so it produces
// a small memory leak.
//----------------------------------------------------------------------
extern ANNkd_leaf *KD_TRIVIAL; // trivial (empty) leaf node
//----------------------------------------------------------------------
// kd-tree splitting node.
// Splitting nodes contain a cutting dimension and a cutting value.
// These indicate the axis-parellel plane which subdivide the
// box for this node. The extent of the bounding box along the
// cutting dimension is maintained (this is used to speed up point
// to box distance calculations) [we do not store the entire bounding
// box since this may be wasteful of space in high dimensions].
// We also store pointers to the 2 children.
//----------------------------------------------------------------------
class ANNkd_split : public ANNkd_node // splitting node of a kd-tree
{
int cut_dim; // dim orthogonal to cutting plane
ANNcoord cut_val; // location of cutting plane
ANNcoord cd_bnds[2]; // lower and upper bounds of
// rectangle along cut_dim
ANNkd_ptr child[2]; // left and right children
public:
ANNkd_split( // constructor
int cd, // cutting dimension
ANNcoord cv, // cutting value
ANNcoord lv, ANNcoord hv, // low and high values
ANNkd_ptr lc=NULL, ANNkd_ptr hc=NULL) // children
{
cut_dim = cd; // cutting dimension
cut_val = cv; // cutting value
cd_bnds[ANN_LO] = lv; // lower bound for rectangle
cd_bnds[ANN_HI] = hv; // upper bound for rectangle
child[ANN_LO] = lc; // left child
child[ANN_HI] = hc; // right child
}
~ANNkd_split() // destructor
{
if (child[ANN_LO]!= NULL && child[ANN_LO]!= KD_TRIVIAL)
delete child[ANN_LO];
if (child[ANN_HI]!= NULL && child[ANN_HI]!= KD_TRIVIAL)
delete child[ANN_HI];
}
virtual void getStats( // get tree statistics
int dim, // dimension of space
ANNkdStats &st, // statistics
ANNorthRect &bnd_box); // bounding box
virtual void print(int level, ostream &out);// print node
virtual void dump(ostream &out); // dump node
virtual void ann_search(ANNdist); // standard search
virtual void ann_pri_search(ANNdist); // priority search
virtual void ann_FR_search(ANNdist); // fixed-radius search
};
//----------------------------------------------------------------------
// External entry points
//----------------------------------------------------------------------
ANNkd_ptr rkd_tree( // recursive construction of kd-tree
ANNpointArray pa, // point array (unaltered)
ANNidxArray pidx, // point indices to store in subtree
int n, // number of points
int dim, // dimension of space
int bsp, // bucket space
ANNorthRect &bnd_box, // bounding box for current node
ANNkd_splitter splitter); // splitting routine
#endif
-439
View File
@@ -1,439 +0,0 @@
//----------------------------------------------------------------------
// File: kd_util.cpp
// Programmer: Sunil Arya and David Mount
// Description: Common utilities for kd-trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#include "kd_util.h" // kd-utility declarations
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// The following routines are utility functions for manipulating
// points sets, used in determining splitting planes for kd-tree
// construction.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// NOTE: Virtually all point indexing is done through an index (i.e.
// permutation) array pidx. Consequently, a reference to the d-th
// coordinate of the i-th point is pa[pidx[i]][d]. The macro PA(i,d)
// is a shorthand for this.
//----------------------------------------------------------------------
// standard 2-d indirect indexing
#define PA(i,d) (pa[pidx[(i)]][(d)])
// accessing a single point
#define PP(i) (pa[pidx[(i)]])
//----------------------------------------------------------------------
// annAspectRatio
// Compute the aspect ratio (ratio of longest to shortest side)
// of a rectangle.
//----------------------------------------------------------------------
double annAspectRatio(
int dim, // dimension
const ANNorthRect &bnd_box) // bounding cube
{
ANNcoord length = bnd_box.hi[0] - bnd_box.lo[0];
ANNcoord min_length = length; // min side length
ANNcoord max_length = length; // max side length
for (int d = 0; d < dim; d++) {
length = bnd_box.hi[d] - bnd_box.lo[d];
if (length < min_length) min_length = length;
if (length > max_length) max_length = length;
}
return max_length/min_length;
}
//----------------------------------------------------------------------
// annEnclRect, annEnclCube
// These utilities compute the smallest rectangle and cube enclosing
// a set of points, respectively.
//----------------------------------------------------------------------
void annEnclRect(
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension
ANNorthRect &bnds) // bounding cube (returned)
{
for (int d = 0; d < dim; d++) { // find smallest enclosing rectangle
ANNcoord lo_bnd = PA(0,d); // lower bound on dimension d
ANNcoord hi_bnd = PA(0,d); // upper bound on dimension d
for (int i = 0; i < n; i++) {
if (PA(i,d) < lo_bnd) lo_bnd = PA(i,d);
else if (PA(i,d) > hi_bnd) hi_bnd = PA(i,d);
}
bnds.lo[d] = lo_bnd;
bnds.hi[d] = hi_bnd;
}
}
void annEnclCube( // compute smallest enclosing cube
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension
ANNorthRect &bnds) // bounding cube (returned)
{
int d;
// compute smallest enclosing rect
annEnclRect(pa, pidx, n, dim, bnds);
ANNcoord max_len = 0; // max length of any side
for (d = 0; d < dim; d++) { // determine max side length
ANNcoord len = bnds.hi[d] - bnds.lo[d];
if (len > max_len) { // update max_len if longest
max_len = len;
}
}
for (d = 0; d < dim; d++) { // grow sides to match max
ANNcoord len = bnds.hi[d] - bnds.lo[d];
ANNcoord half_diff = (max_len - len) / 2;
bnds.lo[d] -= half_diff;
bnds.hi[d] += half_diff;
}
}
//----------------------------------------------------------------------
// annBoxDistance - utility routine which computes distance from point to
// box (Note: most distances to boxes are computed using incremental
// distance updates, not this function.)
//----------------------------------------------------------------------
ANNdist annBoxDistance( // compute distance from point to box
const ANNpoint q, // the point
const ANNpoint lo, // low point of box
const ANNpoint hi, // high point of box
int dim) // dimension of space
{
register ANNdist dist = 0.0; // sum of squared distances
register ANNdist t;
for (register int d = 0; d < dim; d++) {
if (q[d] < lo[d]) { // q is left of box
t = ANNdist(lo[d]) - ANNdist(q[d]);
dist = ANN_SUM(dist, ANN_POW(t));
}
else if (q[d] > hi[d]) { // q is right of box
t = ANNdist(q[d]) - ANNdist(hi[d]);
dist = ANN_SUM(dist, ANN_POW(t));
}
}
ANN_FLOP(4*dim) // increment floating op count
return dist;
}
//----------------------------------------------------------------------
// annSpread - find spread along given dimension
// annMinMax - find min and max coordinates along given dimension
// annMaxSpread - find dimension of max spread
//----------------------------------------------------------------------
ANNcoord annSpread( // compute point spread along dimension
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int d) // dimension to check
{
ANNcoord min = PA(0,d); // compute max and min coords
ANNcoord max = PA(0,d);
for (int i = 1; i < n; i++) {
ANNcoord c = PA(i,d);
if (c < min) min = c;
else if (c > max) max = c;
}
return (max - min); // total spread is difference
}
void annMinMax( // compute min and max coordinates along dim
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension to check
ANNcoord &min, // minimum value (returned)
ANNcoord &max) // maximum value (returned)
{
min = PA(0,d); // compute max and min coords
max = PA(0,d);
for (int i = 1; i < n; i++) {
ANNcoord c = PA(i,d);
if (c < min) min = c;
else if (c > max) max = c;
}
}
int annMaxSpread( // compute dimension of max spread
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim) // dimension of space
{
int max_dim = 0; // dimension of max spread
ANNcoord max_spr = 0; // amount of max spread
if (n == 0) return max_dim; // no points, who cares?
for (int d = 0; d < dim; d++) { // compute spread along each dim
ANNcoord spr = annSpread(pa, pidx, n, d);
if (spr > max_spr) { // bigger than current max
max_spr = spr;
max_dim = d;
}
}
return max_dim;
}
//----------------------------------------------------------------------
// annMedianSplit - split point array about its median
// Splits a subarray of points pa[0..n] about an element of given
// rank (median: n_lo = n/2) with respect to dimension d. It places
// the element of rank n_lo-1 correctly (because our splitting rule
// takes the mean of these two). On exit, the array is permuted so
// that:
//
// pa[0..n_lo-2][d] <= pa[n_lo-1][d] <= pa[n_lo][d] <= pa[n_lo+1..n-1][d].
//
// The mean of pa[n_lo-1][d] and pa[n_lo][d] is returned as the
// splitting value.
//
// All indexing is done indirectly through the index array pidx.
//
// This function uses the well known selection algorithm due to
// C.A.R. Hoare.
//----------------------------------------------------------------------
// swap two points in pa array
#define PASWAP(a,b) { int tmp = pidx[a]; pidx[a] = pidx[b]; pidx[b] = tmp; }
void annMedianSplit(
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord &cv, // cutting value
int n_lo) // split into n_lo and n-n_lo
{
int l = 0; // left end of current subarray
int r = n-1; // right end of current subarray
while (l < r) {
register int i = (r+l)/2; // select middle as pivot
register int k;
if (PA(i,d) > PA(r,d)) // make sure last > pivot
PASWAP(i,r)
PASWAP(l,i); // move pivot to first position
ANNcoord c = PA(l,d); // pivot value
i = l;
k = r;
for(;;) { // pivot about c
while (PA(++i,d) < c) ;
while (PA(--k,d) > c) ;
if (i < k) PASWAP(i,k) else break;
}
PASWAP(l,k); // pivot winds up in location k
if (k > n_lo) r = k-1; // recurse on proper subarray
else if (k < n_lo) l = k+1;
else break; // got the median exactly
}
if (n_lo > 0) { // search for next smaller item
ANNcoord c = PA(0,d); // candidate for max
int k = 0; // candidate's index
for (int i = 1; i < n_lo; i++) {
if (PA(i,d) > c) {
c = PA(i,d);
k = i;
}
}
PASWAP(n_lo-1, k); // max among pa[0..n_lo-1] to pa[n_lo-1]
}
// cut value is midpoint value
cv = (PA(n_lo-1,d) + PA(n_lo,d))/2.0;
}
//----------------------------------------------------------------------
// annPlaneSplit - split point array about a cutting plane
// Split the points in an array about a given plane along a
// given cutting dimension. On exit, br1 and br2 are set so
// that:
//
// pa[ 0 ..br1-1] < cv
// pa[br1..br2-1] == cv
// pa[br2.. n -1] > cv
//
// All indexing is done indirectly through the index array pidx.
//
//----------------------------------------------------------------------
void annPlaneSplit( // split points by a plane
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord cv, // cutting value
int &br1, // first break (values < cv)
int &br2) // second break (values == cv)
{
int l = 0;
int r = n-1;
for(;;) { // partition pa[0..n-1] about cv
while (l < n && PA(l,d) < cv) l++;
while (r >= 0 && PA(r,d) >= cv) r--;
if (l > r) break;
PASWAP(l,r);
l++; r--;
}
br1 = l; // now: pa[0..br1-1] < cv <= pa[br1..n-1]
r = n-1;
for(;;) { // partition pa[br1..n-1] about cv
while (l < n && PA(l,d) <= cv) l++;
while (r >= br1 && PA(r,d) > cv) r--;
if (l > r) break;
PASWAP(l,r);
l++; r--;
}
br2 = l; // now: pa[br1..br2-1] == cv < pa[br2..n-1]
}
//----------------------------------------------------------------------
// annBoxSplit - split point array about a orthogonal rectangle
// Split the points in an array about a given orthogonal
// rectangle. On exit, n_in is set to the number of points
// that are inside (or on the boundary of) the rectangle.
//
// All indexing is done indirectly through the index array pidx.
//
//----------------------------------------------------------------------
void annBoxSplit( // split points by a box
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension of space
ANNorthRect &box, // the box
int &n_in) // number of points inside (returned)
{
int l = 0;
int r = n-1;
for(;;) { // partition pa[0..n-1] about box
while (l < n && box.inside(dim, PP(l))) l++;
while (r >= 0 && !box.inside(dim, PP(r))) r--;
if (l > r) break;
PASWAP(l,r);
l++; r--;
}
n_in = l; // now: pa[0..n_in-1] inside and rest outside
}
//----------------------------------------------------------------------
// annSplitBalance - compute balance factor for a given plane split
// Balance factor is defined as the number of points lying
// below the splitting value minus n/2 (median). Thus, a
// median split has balance 0, left of this is negative and
// right of this is positive. (The points are unchanged.)
//----------------------------------------------------------------------
int annSplitBalance( // determine balance factor of a split
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord cv) // cutting value
{
int n_lo = 0;
for(int i = 0; i < n; i++) { // count number less than cv
if (PA(i,d) < cv) n_lo++;
}
return n_lo - n/2;
}
//----------------------------------------------------------------------
// annBox2Bnds - convert bounding box to list of bounds
// Given two boxes, an inner box enclosed within a bounding
// box, this routine determines all the sides for which the
// inner box is strictly contained with the bounding box,
// and adds an appropriate entry to a list of bounds. Then
// we allocate storage for the final list of bounds, and return
// the resulting list and its size.
//----------------------------------------------------------------------
void annBox2Bnds( // convert inner box to bounds
const ANNorthRect &inner_box, // inner box
const ANNorthRect &bnd_box, // enclosing box
int dim, // dimension of space
int &n_bnds, // number of bounds (returned)
ANNorthHSArray &bnds) // bounds array (returned)
{
int i;
n_bnds = 0; // count number of bounds
for (i = 0; i < dim; i++) {
if (inner_box.lo[i] > bnd_box.lo[i]) // low bound is inside
n_bnds++;
if (inner_box.hi[i] < bnd_box.hi[i]) // high bound is inside
n_bnds++;
}
bnds = new ANNorthHalfSpace[n_bnds]; // allocate appropriate size
int j = 0;
for (i = 0; i < dim; i++) { // fill the array
if (inner_box.lo[i] > bnd_box.lo[i]) {
bnds[j].cd = i;
bnds[j].cv = inner_box.lo[i];
bnds[j].sd = +1;
j++;
}
if (inner_box.hi[i] < bnd_box.hi[i]) {
bnds[j].cd = i;
bnds[j].cv = inner_box.hi[i];
bnds[j].sd = -1;
j++;
}
}
}
//----------------------------------------------------------------------
// annBnds2Box - convert list of bounds to bounding box
// Given an enclosing box and a list of bounds, this routine
// computes the corresponding inner box. It is assumed that
// the box points have been allocated already.
//----------------------------------------------------------------------
void annBnds2Box(
const ANNorthRect &bnd_box, // enclosing box
int dim, // dimension of space
int n_bnds, // number of bounds
ANNorthHSArray bnds, // bounds array
ANNorthRect &inner_box) // inner box (returned)
{
annAssignRect(dim, inner_box, bnd_box); // copy bounding box to inner
for (int i = 0; i < n_bnds; i++) {
bnds[i].project(inner_box.lo); // project each endpoint
bnds[i].project(inner_box.hi);
}
}
-124
View File
@@ -1,124 +0,0 @@
//----------------------------------------------------------------------
// File: kd_util.h
// Programmer: Sunil Arya and David Mount
// Description: Common utilities for kd- trees
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef ANN_kd_util_H
#define ANN_kd_util_H
#include "kd_tree.h" // kd-tree declarations
//----------------------------------------------------------------------
// externally accessible functions
//----------------------------------------------------------------------
double annAspectRatio( // compute aspect ratio of box
int dim, // dimension
const ANNorthRect &bnd_box); // bounding cube
void annEnclRect( // compute smallest enclosing rectangle
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension
ANNorthRect &bnds); // bounding cube (returned)
void annEnclCube( // compute smallest enclosing cube
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension
ANNorthRect &bnds); // bounding cube (returned)
ANNdist annBoxDistance( // compute distance from point to box
const ANNpoint q, // the point
const ANNpoint lo, // low point of box
const ANNpoint hi, // high point of box
int dim); // dimension of space
ANNcoord annSpread( // compute point spread along dimension
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int d); // dimension to check
void annMinMax( // compute min and max coordinates along dim
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension to check
ANNcoord& min, // minimum value (returned)
ANNcoord& max); // maximum value (returned)
int annMaxSpread( // compute dimension of max spread
ANNpointArray pa, // point array
ANNidxArray pidx, // point indices
int n, // number of points
int dim); // dimension of space
void annMedianSplit( // split points along median value
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord &cv, // cutting value
int n_lo); // split into n_lo and n-n_lo
void annPlaneSplit( // split points by a plane
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord cv, // cutting value
int &br1, // first break (values < cv)
int &br2); // second break (values == cv)
void annBoxSplit( // split points by a box
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int dim, // dimension of space
ANNorthRect &box, // the box
int &n_in); // number of points inside (returned)
int annSplitBalance( // determine balance factor of a split
ANNpointArray pa, // points to split
ANNidxArray pidx, // point indices
int n, // number of points
int d, // dimension along which to split
ANNcoord cv); // cutting value
void annBox2Bnds( // convert inner box to bounds
const ANNorthRect &inner_box, // inner box
const ANNorthRect &bnd_box, // enclosing box
int dim, // dimension of space
int &n_bnds, // number of bounds (returned)
ANNorthHSArray &bnds); // bounds array (returned)
void annBnds2Box( // convert bounds to inner box
const ANNorthRect &bnd_box, // enclosing box
int dim, // dimension of space
int n_bnds, // number of bounds
ANNorthHSArray bnds, // bounds array
ANNorthRect &inner_box); // inner box (returned)
#endif
-134
View File
@@ -1,134 +0,0 @@
//----------------------------------------------------------------------
// File: perf.cpp
// Programmer: Sunil Arya and David Mount
// Description: Methods for performance stats
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Changed names to avoid namespace conflicts.
// Added flush after printing performance stats to fix bug
// in Microsoft Windows version.
//----------------------------------------------------------------------
#include <ANN/ANN.h> // basic ANN includes
#include <ANN/ANNperf.h> // performance includes
using namespace std; // make std:: available
//----------------------------------------------------------------------
// Performance statistics
// The following data and routines are used for computing
// performance statistics for nearest neighbor searching.
// Because these routines can slow the code down, they can be
// activated and deactiviated by defining the PERF variable,
// by compiling with the option: -DPERF
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Global counters for performance measurement
//----------------------------------------------------------------------
int ann_Ndata_pts = 0; // number of data points
int ann_Nvisit_lfs = 0; // number of leaf nodes visited
int ann_Nvisit_spl = 0; // number of splitting nodes visited
int ann_Nvisit_shr = 0; // number of shrinking nodes visited
int ann_Nvisit_pts = 0; // visited points for one query
int ann_Ncoord_hts = 0; // coordinate hits for one query
int ann_Nfloat_ops = 0; // floating ops for one query
ANNsampStat ann_visit_lfs; // stats on leaf nodes visits
ANNsampStat ann_visit_spl; // stats on splitting nodes visits
ANNsampStat ann_visit_shr; // stats on shrinking nodes visits
ANNsampStat ann_visit_nds; // stats on total nodes visits
ANNsampStat ann_visit_pts; // stats on points visited
ANNsampStat ann_coord_hts; // stats on coordinate hits
ANNsampStat ann_float_ops; // stats on floating ops
//
ANNsampStat ann_average_err; // average error
ANNsampStat ann_rank_err; // rank error
//----------------------------------------------------------------------
// Routines for statistics.
//----------------------------------------------------------------------
DLL_API void annResetStats(int data_size) // reset stats for a set of queries
{
ann_Ndata_pts = data_size;
ann_visit_lfs.reset();
ann_visit_spl.reset();
ann_visit_shr.reset();
ann_visit_nds.reset();
ann_visit_pts.reset();
ann_coord_hts.reset();
ann_float_ops.reset();
ann_average_err.reset();
ann_rank_err.reset();
}
DLL_API void annResetCounts() // reset counts for one query
{
ann_Nvisit_lfs = 0;
ann_Nvisit_spl = 0;
ann_Nvisit_shr = 0;
ann_Nvisit_pts = 0;
ann_Ncoord_hts = 0;
ann_Nfloat_ops = 0;
}
DLL_API void annUpdateStats() // update stats with current counts
{
ann_visit_lfs += ann_Nvisit_lfs;
ann_visit_nds += ann_Nvisit_spl + ann_Nvisit_lfs;
ann_visit_spl += ann_Nvisit_spl;
ann_visit_shr += ann_Nvisit_shr;
ann_visit_pts += ann_Nvisit_pts;
ann_coord_hts += ann_Ncoord_hts;
ann_float_ops += ann_Nfloat_ops;
}
// print a single statistic
void print_one_stat(char *title, ANNsampStat s, double div)
{
cout << title << "= [ ";
cout.width(9); cout << s.mean()/div << " : ";
cout.width(9); cout << s.stdDev()/div << " ]<";
cout.width(9); cout << s.min()/div << " , ";
cout.width(9); cout << s.max()/div << " >\n";
}
DLL_API void annPrintStats( // print statistics for a run
ANNbool validate) // true if average errors desired
{
cout.precision(4); // set floating precision
cout << " (Performance stats: "
<< " [ mean : stddev ]< min , max >\n";
print_one_stat(" leaf_nodes ", ann_visit_lfs, 1);
print_one_stat(" splitting_nodes ", ann_visit_spl, 1);
print_one_stat(" shrinking_nodes ", ann_visit_shr, 1);
print_one_stat(" total_nodes ", ann_visit_nds, 1);
print_one_stat(" points_visited ", ann_visit_pts, 1);
print_one_stat(" coord_hits/pt ", ann_coord_hts, ann_Ndata_pts);
print_one_stat(" floating_ops_(K) ", ann_float_ops, 1000);
if (validate) {
print_one_stat(" average_error ", ann_average_err, 1);
print_one_stat(" rank_error ", ann_rank_err, 1);
}
cout.precision(0); // restore the default
cout << " )\n";
cout.flush();
}
-125
View File
@@ -1,125 +0,0 @@
//----------------------------------------------------------------------
// File: pr_queue.h
// Programmer: Sunil Arya and David Mount
// Description: Include file for priority queue and related
// structures.
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef PR_QUEUE_H
#define PR_QUEUE_H
#include <ANN/ANNx.h> // all ANN includes
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Basic types.
//----------------------------------------------------------------------
typedef void *PQinfo; // info field is generic pointer
typedef ANNdist PQkey; // key field is distance
//----------------------------------------------------------------------
// Priority queue
// A priority queue is a list of items, along with associated
// priorities. The basic operations are insert and extract_minimum.
//
// The priority queue is maintained using a standard binary heap.
// (Implementation note: Indexing is performed from [1..max] rather
// than the C standard of [0..max-1]. This simplifies parent/child
// computations.) User information consists of a void pointer,
// and the user is responsible for casting this quantity into whatever
// useful form is desired.
//
// Because the priority queue is so central to the efficiency of
// query processing, all the code is inline.
//----------------------------------------------------------------------
class ANNpr_queue {
struct pq_node { // node in priority queue
PQkey key; // key value
PQinfo info; // info field
};
int n; // number of items in queue
int max_size; // maximum queue size
pq_node *pq; // the priority queue (array of nodes)
public:
ANNpr_queue(int max) // constructor (given max size)
{
n = 0; // initially empty
max_size = max; // maximum number of items
pq = new pq_node[max+1]; // queue is array [1..max] of nodes
}
~ANNpr_queue() // destructor
{ delete [] pq; }
ANNbool empty() // is queue empty?
{ if (n==0) return ANNtrue; else return ANNfalse; }
ANNbool non_empty() // is queue nonempty?
{ if (n==0) return ANNfalse; else return ANNtrue; }
void reset() // make existing queue empty
{ n = 0; }
inline void insert( // insert item (inlined for speed)
PQkey kv, // key value
PQinfo inf) // item info
{
if (++n > max_size) annError("Priority queue overflow.", ANNabort);
register int r = n;
while (r > 1) { // sift up new item
register int p = r/2;
ANN_FLOP(1) // increment floating ops
if (pq[p].key <= kv) // in proper order
break;
pq[r] = pq[p]; // else swap with parent
r = p;
}
pq[r].key = kv; // insert new item at final location
pq[r].info = inf;
}
inline void extr_min( // extract minimum (inlined for speed)
PQkey &kv, // key (returned)
PQinfo &inf) // item info (returned)
{
kv = pq[1].key; // key of min item
inf = pq[1].info; // information of min item
register PQkey kn = pq[n--].key;// last item in queue
register int p = 1; // p points to item out of position
register int r = p<<1; // left child of p
while (r <= n) { // while r is still within the heap
ANN_FLOP(2) // increment floating ops
// set r to smaller child of p
if (r < n && pq[r].key > pq[r+1].key) r++;
if (kn <= pq[r].key) // in proper order
break;
pq[p] = pq[r]; // else swap with child
p = r; // advance pointers
r = p<<1;
}
pq[p] = pq[n+1]; // insert last item in proper place
}
};
#endif
-118
View File
@@ -1,118 +0,0 @@
//----------------------------------------------------------------------
// File: pr_queue_k.h
// Programmer: Sunil Arya and David Mount
// Description: Include file for priority queue with k items.
// Last modified: 01/04/05 (Version 1.0)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
//----------------------------------------------------------------------
#ifndef PR_QUEUE_K_H
#define PR_QUEUE_K_H
#include <ANN/ANNx.h> // all ANN includes
#include <ANN/ANNperf.h> // performance evaluation
//----------------------------------------------------------------------
// Basic types
//----------------------------------------------------------------------
typedef ANNdist PQKkey; // key field is distance
typedef int PQKinfo; // info field is int
//----------------------------------------------------------------------
// Constants
// The NULL key value is used to initialize the priority queue, and
// so it should be larger than any valid distance, so that it will
// be replaced as legal distance values are inserted. The NULL
// info value must be a nonvalid array index, we use ANN_NULL_IDX,
// which is guaranteed to be negative.
//----------------------------------------------------------------------
const PQKkey PQ_NULL_KEY = ANN_DIST_INF; // nonexistent key value
const PQKinfo PQ_NULL_INFO = ANN_NULL_IDX; // nonexistent info value
//----------------------------------------------------------------------
// ANNmin_k
// An ANNmin_k structure is one which maintains the smallest
// k values (of type PQKkey) and associated information (of type
// PQKinfo). The special info and key values PQ_NULL_INFO and
// PQ_NULL_KEY means that thise entry is empty.
//
// It is currently implemented using an array with k items.
// Items are stored in increasing sorted order, and insertions
// are made through standard insertion sort. (This is quite
// inefficient, but current applications call for small values
// of k and relatively few insertions.)
//
// Note that the list contains k+1 entries, but the last entry
// is used as a simple placeholder and is otherwise ignored.
//----------------------------------------------------------------------
class ANNmin_k {
struct mk_node { // node in min_k structure
PQKkey key; // key value
PQKinfo info; // info field (user defined)
};
int k; // max number of keys to store
int n; // number of keys currently active
mk_node *mk; // the list itself
public:
ANNmin_k(int max) // constructor (given max size)
{
n = 0; // initially no items
k = max; // maximum number of items
mk = new mk_node[max+1]; // sorted array of keys
}
~ANNmin_k() // destructor
{ delete [] mk; }
PQKkey ANNmin_key() // return minimum key
{ return (n > 0 ? mk[0].key : PQ_NULL_KEY); }
PQKkey max_key() // return maximum key
{ return (n == k ? mk[k-1].key : PQ_NULL_KEY); }
PQKkey ith_smallest_key(int i) // ith smallest key (i in [0..n-1])
{ return (i < n ? mk[i].key : PQ_NULL_KEY); }
PQKinfo ith_smallest_info(int i) // info for ith smallest (i in [0..n-1])
{ return (i < n ? mk[i].info : PQ_NULL_INFO); }
inline void insert( // insert item (inlined for speed)
PQKkey kv, // key value
PQKinfo inf) // item info
{
register int i;
// slide larger values up
for (i = n; i > 0; i--) {
if (mk[i-1].key > kv)
mk[i] = mk[i-1];
else
break;
}
mk[i].key = kv; // store element here
mk[i].info = inf;
if (n < k) n++; // increment number of items
ANN_FLOP(k-i+1) // increment floating ops
}
};
#endif
-96
View File
@@ -1,96 +0,0 @@
#-----------------------------------------------------------------------------
# Makefile for the test and evaluation program
#
# ANN: Approximate Nearest Neighbors
# Version: 1.1.1 08/04/06
#-----------------------------------------------------------------------------
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
# David Mount. All Rights Reserved.
#
# This software and related documentation is part of the Approximate
# Nearest Neighbor Library (ANN). This software is provided under
# the provisions of the Lesser GNU Public License (LGPL). See the
# file ../ReadMe.txt for further information.
#
# The University of Maryland (U.M.) and the authors make no
# representations about the suitability or fitness of this software for
# any purpose. It is provided "as is" without express or implied
# warranty.
#-----------------------------------------------------------------------------
# Revision 0.1 03/04/98
# Initial release
# Revision 1.1.1 08/04/06
# Added copyright/license
#-----------------------------------------------------------------------------
# Note: For full performance measurements, it is assumed that the library
# and this program have both been compiled with the -DANN_PERF flag. See
# the Makefile in the ANN base directory for this flag.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Basic definitions
# BASEDIR where include, src, lib, ... are
# INCDIR include directory
# LIBDIR library directory
# BINDIR bin directory
# LDFLAGS loader flags
# ANNLIBS ANN library
# OTHERLIBS other libraries
#-----------------------------------------------------------------------------
BASEDIR = ..
INCDIR = $(BASEDIR)/include
LIBDIR = $(BASEDIR)/lib
BINDIR = $(BASEDIR)/bin
LDFLAGS = -L$(LIBDIR)
ANNLIBS = -lANN
OTHERLIBS = -lm
#-----------------------------------------------------------------------------
# Some more definitions
# ANNTEST name of test program
#-----------------------------------------------------------------------------
ANNTEST = ann_test
HEADERS = rand.h
TESTSOURCES = ann_test.cpp rand.cpp
TESTOBJECTS = $(TESTSOURCES:.cpp=.o)
#-----------------------------------------------------------------------------
# Make the program
#-----------------------------------------------------------------------------
default:
@echo "Specify a target configuration"
targets: $(BINDIR)/$(ANNTEST)
$(BINDIR)/$(ANNTEST): $(TESTOBJECTS) $(LIBDIR)/$(ANNLIB)
$(C++) $(TESTOBJECTS) -o $(ANNTEST) $(LDFLAGS) $(ANNLIBS) $(OTHERLIBS)
mv $(ANNTEST) $(BINDIR)
#-----------------------------------------------------------------------------
# configuration definitions
#-----------------------------------------------------------------------------
include ../Make-config
#-----------------------------------------------------------------------------
# Objects
#-----------------------------------------------------------------------------
ann_test.o: ann_test.cpp
$(C++) -c -I$(INCDIR) $(CFLAGS) ann_test.cpp
rand.o: rand.cpp
$(C++) -c -I$(INCDIR) $(CFLAGS) rand.cpp
#-----------------------------------------------------------------------------
# Cleaning
#-----------------------------------------------------------------------------
clean:
-rm -f *.o *.out core
realclean: clean
-1640
View File
File diff suppressed because it is too large Load Diff
-594
View File
@@ -1,594 +0,0 @@
//----------------------------------------------------------------------
// File: rand.cpp
// Programmer: Sunil Arya and David Mount
// Description: Routines for random point generation
// Last modified: 08/04/06 (Version 1.1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 0.2 03/26/98
// Changed random/srandom declarations for SGI's.
// Revision 1.0 04/01/05
// annClusGauss centers distributed over [-1,1] rather than [0,1]
// Added annClusOrthFlats distribution
// Changed procedure names to avoid namespace conflicts
// Added annClusFlats distribution
// Added rand/srand option and fixed annRan0() initialization.
// Revision 1.1.1 08/04/06
// Added planted distribution
//----------------------------------------------------------------------
#include "rand.h" // random generator declarations
using namespace std; // make std:: accessible
//----------------------------------------------------------------------
// Globals
//----------------------------------------------------------------------
int annIdum = 0; // used for random number generation
//------------------------------------------------------------------------
// annRan0 - (safer) uniform random number generator
//
// The code given here is taken from "Numerical Recipes in C" by
// William Press, Brian Flannery, Saul Teukolsky, and William
// Vetterling. The task of the code is to do an additional randomizing
// shuffle on the system-supplied random number generator to make it
// safer to use.
//
// Returns a uniform deviate between 0.0 and 1.0 using the
// system-supplied routine random() or rand(). Set the global
// annIdum to any negative value to initialise or reinitialise
// the sequence.
//------------------------------------------------------------------------
double annRan0()
{
const int TAB_SIZE = 97; // table size: any large number
int j;
static double y, v[TAB_SIZE];
static int iff = 0;
const double RAN_DIVISOR = double(ANN_RAND_MAX + 1UL);
if (RAN_DIVISOR < 0) {
cout << "RAN_DIVISOR " << RAN_DIVISOR << endl;
exit(0);
}
//--------------------------------------------------------------------
// As a precaution against misuse, we will always initialize on the
// first call, even if "annIdum" is not set negative. Determine
// "maxran", the next integer after the largest representable value
// of type int. We assume this is a factor of 2 smaller than the
// corresponding value of type unsigned int.
//--------------------------------------------------------------------
if (annIdum < 0 || iff == 0) { // initialize
iff = 1;
ANN_SRAND(annIdum); // (re)seed the generator
annIdum = 1;
for (j = 0; j < TAB_SIZE; j++) // exercise the system routine
ANN_RAND(); // (values intentionally ignored)
for (j = 0; j < TAB_SIZE; j++) // then save TAB_SIZE-1 values
v[j] = ANN_RAND();
y = ANN_RAND(); // generate starting value
}
//--------------------------------------------------------------------
// This is where we start if not initializing. Use the previously
// saved random number y to get an index j between 1 and TAB_SIZE-1.
// Then use the corresponding v[j] for both the next j and as the
// output number.
//--------------------------------------------------------------------
j = int(TAB_SIZE * (y / RAN_DIVISOR));
y = v[j];
v[j] = ANN_RAND(); // refill the table entry
return y / RAN_DIVISOR;
}
//------------------------------------------------------------------------
// annRanInt - generate a random integer from {0,1,...,n-1}
//
// If n == 0, then -1 is returned.
//------------------------------------------------------------------------
static int annRanInt(
int n)
{
int r = (int) (annRan0()*n);
if (r == n) r--; // (in case annRan0() == 1 or n == 0)
return r;
}
//------------------------------------------------------------------------
// annRanUnif - generate a random uniform in [lo,hi]
//------------------------------------------------------------------------
static double annRanUnif(
double lo,
double hi)
{
return annRan0()*(hi-lo) + lo;
}
//------------------------------------------------------------------------
// annRanGauss - Gaussian random number generator
// Returns a normally distributed deviate with zero mean and unit
// variance, using annRan0() as the source of uniform deviates.
//------------------------------------------------------------------------
static double annRanGauss()
{
static int iset=0;
static double gset;
if (iset == 0) { // we don't have a deviate handy
double v1, v2;
double r = 2.0;
while (r >= 1.0) {
//------------------------------------------------------------
// Pick two uniform numbers in the square extending from -1 to
// +1 in each direction, see if they are in the circle of radius
// 1. If not, try again
//------------------------------------------------------------
v1 = annRanUnif(-1, 1);
v2 = annRanUnif(-1, 1);
r = v1 * v1 + v2 * v2;
}
double fac = sqrt(-2.0 * log(r) / r);
//-----------------------------------------------------------------
// Now make the Box-Muller transformation to get two normal
// deviates. Return one and save the other for next time.
//-----------------------------------------------------------------
gset = v1 * fac;
iset = 1; // set flag
return v2 * fac;
}
else { // we have an extra deviate handy
iset = 0; // so unset the flag
return gset; // and return it
}
}
//------------------------------------------------------------------------
// annRanLaplace - Laplacian random number generator
// Returns a Laplacian distributed deviate with zero mean and
// unit variance, using annRan0() as the source of uniform deviates.
//
// prob(x) = b/2 * exp(-b * |x|).
//
// b is chosen to be sqrt(2.0) so that the variance of the Laplacian
// distribution [2/(b^2)] becomes 1.
//------------------------------------------------------------------------
static double annRanLaplace()
{
const double b = 1.4142136;
double laprand = -log(annRan0()) / b;
double sign = annRan0();
if (sign < 0.5) laprand = -laprand;
return(laprand);
}
//----------------------------------------------------------------------
// annUniformPts - Generate uniformly distributed points
// A uniform distribution over [-1,1].
//----------------------------------------------------------------------
void annUniformPts( // uniform distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim) // dimension
{
for (int i = 0; i < n; i++) {
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) (annRanUnif(-1,1));
}
}
}
//----------------------------------------------------------------------
// annGaussPts - Generate Gaussian distributed points
// A Gaussian distribution with zero mean and the given standard
// deviation.
//----------------------------------------------------------------------
void annGaussPts( // Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double std_dev) // standard deviation
{
for (int i = 0; i < n; i++) {
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) (annRanGauss() * std_dev);
}
}
}
//----------------------------------------------------------------------
// annLaplacePts - Generate Laplacian distributed points
// Generates a Laplacian distribution (zero mean and unit variance).
//----------------------------------------------------------------------
void annLaplacePts( // Laplacian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim) // dimension
{
for (int i = 0; i < n; i++) {
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) annRanLaplace();
}
}
}
//----------------------------------------------------------------------
// annCoGaussPts - Generate correlated Gaussian distributed points
// Generates a Gauss-Markov distribution of zero mean and unit
// variance.
//----------------------------------------------------------------------
void annCoGaussPts( // correlated-Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double correlation) // correlation
{
double std_dev_w = sqrt(1.0 - correlation * correlation);
for (int i = 0; i < n; i++) {
double previous = annRanGauss();
pa[i][0] = (ANNcoord) previous;
for (int d = 1; d < dim; d++) {
previous = correlation*previous + std_dev_w*annRanGauss();
pa[i][d] = (ANNcoord) previous;
}
}
}
//----------------------------------------------------------------------
// annCoLaplacePts - Generate correlated Laplacian distributed points
// Generates a Laplacian-Markov distribution of zero mean and unit
// variance.
//----------------------------------------------------------------------
void annCoLaplacePts( // correlated-Laplacian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double correlation) // correlation
{
double wn;
double corr_sq = correlation * correlation;
for (int i = 0; i < n; i++) {
double previous = annRanLaplace();
pa[i][0] = (ANNcoord) previous;
for (int d = 1; d < dim; d++) {
double temp = annRan0();
if (temp < corr_sq)
wn = 0.0;
else
wn = annRanLaplace();
previous = correlation * previous + wn;
pa[i][d] = (ANNcoord) previous;
}
}
}
//----------------------------------------------------------------------
// annClusGaussPts - Generate clusters of Gaussian distributed points
// Cluster centers are uniformly distributed over [-1,1], and the
// standard deviation within each cluster is fixed.
//
// Note: Once cluster centers have been set, they are not changed,
// unless new_clust = true. This is so that subsequent calls generate
// points from the same distribution. It follows, of course, that any
// attempt to change the dimension or number of clusters without
// generating new clusters is asking for trouble.
//
// Note: Cluster centers are not generated by a call to uniformPts().
// Although this could be done, it has been omitted for
// compatibility with annClusGaussPts() in the colored version,
// rand_c.cc.
//----------------------------------------------------------------------
void annClusGaussPts( // clustered-Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors
ANNbool new_clust, // generate new clusters.
double std_dev) // standard deviation within clusters
{
static ANNpointArray clusters = NULL;// cluster storage
if (clusters == NULL || new_clust) {// need new cluster centers
if (clusters != NULL) // clusters already exist
annDeallocPts(clusters); // get rid of them
clusters = annAllocPts(n_clus, dim);
// generate cluster center coords
for (int i = 0; i < n_clus; i++) {
for (int d = 0; d < dim; d++) {
clusters[i][d] = (ANNcoord) annRanUnif(-1,1);
}
}
}
for (int i = 0; i < n; i++) {
int c = annRanInt(n_clus); // generate cluster index
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + clusters[c][d]);
}
}
}
//----------------------------------------------------------------------
// annClusOrthFlats - points clustered along orthogonal flats
//
// This distribution consists of a collection points clustered
// among a collection of axis-aligned low dimensional flats in
// the hypercube [-1,1]^d. A set of n_clus orthogonal flats are
// generated, each whose dimension is a random number between 1
// and max_dim. The points are evenly distributed among the clusters.
// For each cluster, we generate points uniformly distributed along
// the flat within the hypercube.
//
// This is done as follows. Each cluster is defined by a d-element
// control vector whose components are either:
//
// CO_FLAG indicating that this component is to be generated
// uniformly in [-1,1],
// x a value other than CO_FLAG in the range [-1,1],
// which indicates that this coordinate is to be
// generated as x plus a Gaussian random deviation
// with the given standard deviation.
//
// The number of zero components is the dimension of the flat, which
// is a random integer in the range from 1 to max_dim. The points
// are disributed between clusters in nearly equal sized groups.
//
// Note: Once cluster centers have been set, they are not changed,
// unless new_clust = true. This is so that subsequent calls generate
// points from the same distribution. It follows, of course, that any
// attempt to change the dimension or number of clusters without
// generating new clusters is asking for trouble.
//
// To make this a bad scenario at query time, query points should be
// selected from a different distribution, e.g. uniform or Gaussian.
//
// We use a little programming trick to generate groups of roughly
// equal size. If n is the total number of points, and n_clus is
// the number of clusters, then the c-th cluster (0 <= c < n_clus)
// is given floor((n+c)/n_clus) points. It can be shown that this
// will exactly consume all n points.
//
// This procedure makes use of the utility procedure, genOrthFlat
// which generates points in one orthogonal flat, according to
// the given control vector.
//
//----------------------------------------------------------------------
const double CO_FLAG = 999; // special flag value
static void genOrthFlat( // generate points on an orthog flat
ANNpointArray pa, // point array
int n, // number of points
int dim, // dimension
double *control, // control vector
double std_dev) // standard deviation
{
for (int i = 0; i < n; i++) { // generate each point
for (int d = 0; d < dim; d++) { // generate each coord
if (control[d] == CO_FLAG) // dimension on flat
pa[i][d] = (ANNcoord) annRanUnif(-1,1);
else // dimension off flat
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + control[d]);
}
}
}
void annClusOrthFlats( // clustered along orthogonal flats
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors
ANNbool new_clust, // generate new clusters.
double std_dev, // standard deviation within clusters
int max_dim) // maximum dimension of the flats
{
static ANNpointArray control = NULL; // control vectors
if (control == NULL || new_clust) { // need new cluster centers
if (control != NULL) { // clusters already exist
annDeallocPts(control); // get rid of them
}
control = annAllocPts(n_clus, dim);
for (int c = 0; c < n_clus; c++) { // generate clusters
int n_dim = 1 + annRanInt(max_dim); // number of dimensions in flat
for (int d = 0; d < dim; d++) { // generate side locations
// prob. of picking next dim
double Prob = ((double) n_dim)/((double) (dim-d));
if (annRan0() < Prob) { // add this one to flat
control[c][d] = CO_FLAG; // flag this entry
n_dim--; // one fewer dim to fill
}
else { // don't take this one
control[c][d] = annRanUnif(-1,1);// random value in [-1,1]
}
}
}
}
int offset = 0; // offset in pa array
for (int c = 0; c < n_clus; c++) { // generate clusters
int pick = (n+c)/n_clus; // number of points to pick
// generate the points
genOrthFlat(pa+offset, pick, dim, control[c], std_dev);
offset += pick; // increment offset
}
}
//----------------------------------------------------------------------
// annClusEllipsoids - points clustered around axis-aligned ellipsoids
//
// This distribution consists of a collection points clustered
// among a collection of low dimensional ellipsoids whose axes
// are alligned with the coordinate axes in the hypercube [-1,1]^d.
// The objective is to model distributions in which the points are
// distributed in lower dimensional subspaces, and within this
// lower dimensional space the points are distributed with a
// Gaussian distribution (with no correlation between the
// dimensions).
//
// The distribution is given the number of clusters or "colors"
// (n_clus), maximum number of dimensions (max_dim) of the lower
// dimensional subspace, a "small" standard deviation
// (std_dev_small), and a "large" standard deviation range
// (std_dev_lo, std_dev_hi).
//
// The algorithm generates n_clus cluster centers uniformly from
// the hypercube [-1,1]^d. For each cluster, it selects the
// dimension of the subspace as a random number r between 1 and
// max_dim. These are the dimensions of the ellipsoid. Then it
// generates a d-element std dev vector whose entries are the
// standard deviation for the coordinates of each cluster in the
// distribution. Among the d-element control vector, r randomly
// chosen values are chosen uniformly from the range [std_dev_lo,
// std_dev_hi]. The remaining values are set to std_dev_small.
//
// Note that annClusGaussPts is a special case of this in which
// max_dim = 0, and std_dev = std_dev_small.
//
// If the flag new_clust is set, then new cluster centers are
// generated.
//
// This procedure makes use of the utility procedure genGauss
// which generates points distributed according to a Gaussian
// distribution.
//
//----------------------------------------------------------------------
static void genGauss( // generate points on a general Gaussian
ANNpointArray pa, // point array
int n, // number of points
int dim, // dimension
double *center, // center vector
double *std_dev) // standard deviation vector
{
for (int i = 0; i < n; i++) {
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) (std_dev[d]*annRanGauss() + center[d]);
}
}
}
void annClusEllipsoids( // clustered around ellipsoids
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors
ANNbool new_clust, // generate new clusters.
double std_dev_small, // small standard deviation
double std_dev_lo, // low standard deviation for ellipses
double std_dev_hi, // high standard deviation for ellipses
int max_dim) // maximum dimension of the flats
{
static ANNpointArray centers = NULL; // cluster centers
static ANNpointArray std_dev = NULL; // standard deviations
if (centers == NULL || new_clust) { // need new cluster centers
if (centers != NULL) // clusters already exist
annDeallocPts(centers); // get rid of them
if (std_dev != NULL) // std deviations already exist
annDeallocPts(std_dev); // get rid of them
centers = annAllocPts(n_clus, dim); // alloc new clusters and devs
std_dev = annAllocPts(n_clus, dim);
for (int i = 0; i < n_clus; i++) { // gen cluster center coords
for (int d = 0; d < dim; d++) {
centers[i][d] = (ANNcoord) annRanUnif(-1,1);
}
}
for (int c = 0; c < n_clus; c++) { // generate cluster std dev
int n_dim = 1 + annRanInt(max_dim); // number of dimensions in flat
for (int d = 0; d < dim; d++) { // generate std dev's
// prob. of picking next dim
double Prob = ((double) n_dim)/((double) (dim-d));
if (annRan0() < Prob) { // add this one to ellipse
// generate random std dev
std_dev[c][d] = annRanUnif(std_dev_lo, std_dev_hi);
n_dim--; // one fewer dim to fill
}
else { // don't take this one
std_dev[c][d] = std_dev_small;// use small std dev
}
}
}
}
int offset = 0; // next slot to fill
for (int c = 0; c < n_clus; c++) { // generate clusters
int pick = (n+c)/n_clus; // number of points to pick
// generate the points
genGauss(pa+offset, pick, dim, centers[c], std_dev[c]);
offset += pick; // increment offset in array
}
}
//----------------------------------------------------------------------
// annPlanted - Generates points from a "planted" distribution
// In high dimensional spaces, interpoint distances tend to be
// highly clustered around the mean value. Approximate nearest
// neighbor searching makes little sense in this context, unless it
// is the case that each query point is significantly closer to its
// nearest neighbor than to other points. Thus, the query points
// should be planted close to the data points. Given a source data
// set, this procedure generates a set of query points having this
// property.
//
// We are given a source data array and a standard deviation. We
// generate points as follows. We select a random point from the
// source data set, and we generate a Gaussian point centered about
// this random point and perturbed by a normal distributed random
// variable with mean zero and the given standard deviation along
// each coordinate.
//
// Note that this essentially the same a clustered Gaussian
// distribution, but where the cluster centers are given by the
// source data set.
//----------------------------------------------------------------------
void annPlanted( // planted nearest neighbors
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
ANNpointArray src, // source point array
int n_src, // source size
double std_dev) // standard deviation about source
{
for (int i = 0; i < n; i++) {
int c = annRanInt(n_src); // generate source index
for (int d = 0; d < dim; d++) {
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + src[c][d]);
}
}
}
-131
View File
@@ -1,131 +0,0 @@
//----------------------------------------------------------------------
// File: rand.h
// Programmer: Sunil Arya and David Mount
// Description: Basic include file for random point generators
// Last modified: 08/04/06 (Version 1.1.1)
//----------------------------------------------------------------------
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
// David Mount. All Rights Reserved.
//
// This software and related documentation is part of the Approximate
// Nearest Neighbor Library (ANN). This software is provided under
// the provisions of the Lesser GNU Public License (LGPL). See the
// file ../ReadMe.txt for further information.
//
// The University of Maryland (U.M.) and the authors make no
// representations about the suitability or fitness of this software for
// any purpose. It is provided "as is" without express or implied
// warranty.
//----------------------------------------------------------------------
// History:
// Revision 0.1 03/04/98
// Initial release
// Revision 1.0 04/01/05
// Added annClusOrthFlats distribution
// Changed procedure names to avoid namespace conflicts
// Added annClusFlats distribution
// Revision 1.1.1 08/04/06
// Added planted distribution
//----------------------------------------------------------------------
#ifndef rand_H
#define rand_H
//----------------------------------------------------------------------
// Basic includes
//----------------------------------------------------------------------
#include <cstdlib> // standard includes (rand/random)
#include <cmath> // math routines
#include <ANN/ANN.h> // basic ANN includes
//----------------------------------------------------------------------
// Although random/srandom is a more reliable random number generator,
// many systems do not have it. If it is not available, set the
// preprocessor symbol ANN_NO_RANDOM, and this will substitute the use
// of rand/srand for them.
//----------------------------------------------------------------------
#ifdef ANN_NO_RANDOM // for systems not having random()
#define ANN_RAND rand
#define ANN_SRAND srand
#define ANN_RAND_MAX RAND_MAX
#else // otherwise use rand()
#define ANN_RAND random
#define ANN_SRAND srandom
#define ANN_RAND_MAX 2147483647UL // 2**{31} - 1
// #define ANN_RAND_MAX 1073741824UL // 2**{30}
#endif
//----------------------------------------------------------------------
// Globals
//----------------------------------------------------------------------
extern int annIdum; // random number seed
//----------------------------------------------------------------------
// External entry points
//----------------------------------------------------------------------
void annUniformPts( // uniform distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim); // dimension
void annGaussPts( // Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double std_dev); // standard deviation
void annCoGaussPts( // correlated-Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double correlation); // correlation
void annLaplacePts( // Laplacian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim); // dimension
void annCoLaplacePts( // correlated-Laplacian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
double correlation); // correlation
void annClusGaussPts( // clustered-Gaussian distribution
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors (clusters)
ANNbool new_clust, // generate new cluster centers
double std_dev); // standard deviation within clusters
void annClusOrthFlats( // clustered along orthogonal flats
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors
ANNbool new_clust, // generate new clusters.
double std_dev, // standard deviation within clusters
int max_dim); // maximum dimension of the flats
void annClusEllipsoids( // clustered around ellipsoids
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
int n_clus, // number of colors
ANNbool new_clust, // generate new clusters.
double std_dev_small, // small standard deviation
double std_dev_lo, // low standard deviation for ellipses
double std_dev_hi, // high standard deviation for ellipses
int max_dim); // maximum dimension of the flats
void annPlanted( // planted nearest neighbors
ANNpointArray pa, // point array (modified)
int n, // number of points
int dim, // dimension
ANNpointArray src, // source point array
int n_src, // source size
double std_dev); // standard deviation about source
#endif
-20
View File
@@ -1,20 +0,0 @@
-0.297462 0.176102
0.565538 -0.361496
0.909313 -0.182785
0.920712 0.478408
0.167682 0.0499836
0.305223 -0.0805835
0.114973 0.882453
0.742916 0.16376
0.0724605 -0.826775
0.690960 -0.559284
0.188485 -0.643934
0.749427 -0.942415
-0.970662 -0.223466
0.916110 0.879597
0.927417 -0.382593
-0.711327 0.278713
-0.519172 0.986146
0.135338 0.924588
-0.0837537 0.61687
0.0520465 0.896306
-10
View File
@@ -1,10 +0,0 @@
0.0902484 -0.207129
-0.419567 0.485743
0.826225 -0.30962
0.694758 0.987088
-0.410807 -0.465182
-0.836501 0.490184
0.588289 0.656408
0.325807 0.38721
-0.532226 -0.727036
-0.52506 -0.853508
-15
View File
@@ -1,15 +0,0 @@
validate on
stats query_stats
dim 2
data_size 20
query_size 10
read_data_pts test1-data.pts
read_query_pts test1-query.pts
bucket_size 1
near_neigh 3
split_rule suggest
shrink_rule none
build_ann
epsilon 0.0
run_queries standard
run_queries priority
-76
View File
@@ -1,76 +0,0 @@
------------------------------------------------------------
ann_test: Version 1.0
Copyright: David M. Mount and Sunil Arya.
Latest Revision: Mar 1, 2005.
------------------------------------------------------------
validate = on (Warning: this may slow execution time.)
stats = query_stats
[Read Data Points:
data_size = 20
file_name = test1-data.pts
dim = 2
]
[Read Query Points:
query_size = 10
file_name = test1-query.pts
dim = 2
]
[Build ann-structure:
split_rule = suggest
shrink_rule = none
data_size = 20
dim = 2
bucket_size = 1
process_time = 0 sec
(Structure Statistics:
n_nodes = 39 (opt = 40, best if < 400)
n_leaves = 20 (0 contain no points)
n_splits = 19
n_shrinks = 0
empty_leaves = 0 percent (best if < 50 percent)
depth = 6 (opt = 4, best if < 17)
avg_aspect_ratio = 1.48847 (best if < 20)
)
]
(Computing true nearest neighbors for validation. This may take time.)
[Run Queries:
query_size = 10
dim = 2
search_method = standard
epsilon = 0
near_neigh = 3
true_nn = 13
query_time = 0 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 6.3 : 2.751 ]< 4 , 11 >
splitting_nodes = [ 8.8 : 3.676 ]< 5 , 15 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 15.1 : 6.35 ]< 9 , 26 >
points_visited = [ 6.3 : 2.751 ]< 4 , 11 >
coord_hits/pt = [ 0.57 : 0.2201 ]< 0.35 , 0.95 >
floating_ops_(K) = [ 0.156 : 0.0563 ]< 0.101 , 0.254 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 10
dim = 2
search_method = priority
epsilon = 0
near_neigh = 3
true_nn = 13
query_time = 0 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 5.9 : 2.025 ]< 4 , 9 >
splitting_nodes = [ 8.7 : 3.498 ]< 5 , 15 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 14.6 : 5.42 ]< 9 , 24 >
points_visited = [ 5.9 : 2.025 ]< 4 , 9 >
coord_hits/pt = [ 0.535 : 0.1667 ]< 0.35 , 0.8 >
floating_ops_(K) = [ 0.1719 : 0.05861 ]< 0.114 , 0.267 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
File diff suppressed because it is too large Load Diff
-100
View File
@@ -1,100 +0,0 @@
0.0902484 -0.207129 -0.419567 0.485743 0.826225 -0.30962 0.694758 0.987088
-0.410807 -0.465182 -0.836501 0.490184 0.588289 0.656408 0.325807 0.38721
-0.532226 -0.727036 -0.52506 -0.853508 0.28637 0.938617 -0.864754 0.622397
-0.408646 -0.522319 0.0388774 -0.893642 0.385806 0.890013 -0.38066 -0.524536
0.916427 -0.941696 0.219294 -0.971436 -0.706532 0.566439 -0.0591963 0.27756
0.692452 -0.210879 0.927987 0.587037 0.610211 0.895158 -0.228196 -0.314064
-0.13253 0.711121 0.605841 0.771335 -0.945103 0.356652 0.00215608 -0.54444
0.0611156 0.921316 0.245255 0.92896 0.562614 0.160313 -0.457179 -0.432326
-0.813199 -0.0630237 0.149021 0.0301869 0.669399 0.984082 -0.304983 0.480589
0.311004 0.515906 -0.667349 -0.464028 -0.554472 0.123471 -0.932191 0.153486
0.488214 -0.456547 0.695901 -0.693933 -0.775879 -0.940794 0.710796 -0.79388
-0.73914 -0.733084 0.300943 0.0726274 -0.722715 -0.414562 0.463033 -0.378469
-0.178166 -0.846243 -0.319029 0.186783 -0.364517 0.915747 -0.300208 -0.599272
-0.544192 0.173829 -0.0957917 0.889828 0.775796 0.148865 -0.430932 0.0342097
-0.969596 -0.545995 -0.98045 -0.57569 0.465756 -0.166752 0.622912 -0.580526
0.0918901 0.635361 -0.934228 -0.0273098 0.65055 0.227406 -0.628807 0.213824
0.216987 -0.653221 -0.789576 0.6252 0.124467 0.477613 -0.259097 0.913287
0.587512 0.377176 -0.393846 0.293478 0.275818 -0.298198 0.063539 -0.592623
0.867649 0.64842 -0.929959 0.677208 -0.302289 -0.230779 0.267189 -0.140577
-0.360362 0.910053 -0.26718 0.167234 -0.0203549 -0.190717 -0.291433 0.756657
0.637052 0.538531 0.200832 0.420082 0.688092 0.500134 0.78368 -0.542742
0.00257324 0.53221 -0.899835 0.503303 -0.46265 0.13425 -0.66756 0.125758
-0.28673 -0.255891 0.0805643 0.154396 -0.304337 0.942248 0.404729 -0.530016
0.330364 -0.469459 0.492101 0.923757 -0.0870035 0.114578 -0.321104 0.586945
0.104922 -0.620678 -0.27497 0.905927 0.219188 -0.495436 -0.762684 0.557364
-0.665582 -0.75013 -0.249321 0.667873 -0.288485 -0.765806 -0.45304 0.919665
-0.493835 0.239472 -0.917625 0.418003 0.273087 0.54198 -0.836992 -0.842215
-0.576808 -0.958153 0.73833 0.0770337 -0.82097 0.0731924 -0.192127 -0.369044
-0.204979 -0.564608 -0.792166 0.356056 -0.50905 -0.217096 -0.45753 -0.998959
0.735413 0.347442 -0.644887 0.178 0.935974 -0.630639 -0.624678 0.946812
0.72101 -0.881322 -0.0914539 0.80997 0.619855 0.299585 -0.0544264 -0.932907
-0.454196 0.903609 0.216595 -0.515838 0.650697 0.322145 -0.0598022 0.29879
0.56218 0.548496 0.116056 -0.109011 0.35975 0.375862 -0.473017 0.179013
0.790441 0.202804 0.370116 -0.299956 -0.789657 0.66881 -0.429629 -0.203547
0.870951 -0.240769 0.472253 -0.874723 -0.67061 -0.434253 0.661868 -0.515051
-0.45736 0.0815795 0.924138 0.0979838 -0.00884649 0.0643335 0.803118 -0.542487
-0.177146 -0.625442 -0.840198 -0.158722 -0.596283 -0.673887 -0.738309 0.439504
0.186587 -0.465294 0.81993 0.754213 -0.929469 0.5224 -0.567962 -0.0020964
-0.727445 0.654887 0.237451 -0.81993 0.461061 -0.330429 -0.423304 -0.11565
-0.638766 -0.623638 0.33871 -0.295169 -0.864833 0.715051 -0.443567 0.530583
0.81889 0.288548 -0.558678 -0.588774 -0.961246 0.46669 0.585559 0.566684
-0.336336 0.911721 -0.353767 -0.387489 -0.0397957 -0.544424 0.388611 -0.49438
0.389995 -0.989308 0.0531768 -0.119235 0.8707 0.190555 -0.829453 -0.0377095
-0.754985 0.722122 -0.486071 -0.0543854 -0.00514588 -0.0407811 -0.923871 0.768664
-0.257839 -0.963332 0.27127 0.90108 0.2946 0.295975 0.133463 -0.203565
0.128047 -0.0221978 0.565967 0.441817 -0.885341 -0.294394 0.752 0.655274
0.455767 -0.659883 0.40248 0.600338 -0.83844 -0.844635 -0.436961 -0.694439
0.494475 -0.85312 -0.703241 -0.0320226 -0.0312604 -0.804464 -0.967423 0.134369
-0.823558 0.72077 0.692424 -0.331696 0.28281 0.956438 -0.512021 0.343271
-0.120567 0.85007 -0.634148 0.479445 0.999095 -0.362764 -0.547786 0.0405272
-0.759062 -0.595061 0.891393 -0.772615 0.699682 0.433783 0.496053 0.989183
-0.830714 0.673363 -0.774558 -0.428386 -0.163786 -0.576139 0.870208 -0.403316
-0.358526 -0.816022 -0.40667 0.888208 0.0927729 0.567724 -0.993948 -0.315037
0.173889 0.324026 0.971654 0.445513 -0.836598 -0.335657 -0.193173 0.544429
-0.383334 0.0514736 -0.667312 -0.650427 -0.173149 -0.785155 -0.427284 -0.773588
-0.942451 -0.429928 -0.296064 0.478439 -0.21067 -0.583727 -0.172756 -0.867286
0.0722371 0.969577 -0.667728 -0.673244 0.975295 -0.468511 0.283715 -0.838649
-0.135551 0.0966441 -0.899046 -0.107455 -0.233247 -0.784231 -0.273956 -0.735285
-0.0414323 0.633082 0.756714 -0.941008 0.7334 -0.558333 0.515249 -0.0495845
0.151553 0.897797 0.535985 -0.435869 0.276652 0.950385 -0.588415 -0.908762
0.836871 -0.309154 0.542942 -0.555574 0.296423 -0.852823 0.0586046 0.907905
-0.037232 -0.50382 0.828129 0.852639 -0.187631 0.110954 -0.520551 0.2231
-0.669727 -0.670437 -0.395765 0.938759 -0.71912 -0.299401 -0.857412 0.136054
-0.426925 -0.323029 0.847521 -0.768077 -0.737279 -0.73427 0.409976 -0.424011
-0.485806 -0.842531 0.425504 0.928987 0.885911 0.193509 -0.786534 -0.0521742
0.477176 0.948246 -0.81151 -0.461006 0.140611 -0.0403634 0.904953 0.527849
0.278327 -0.960566 -0.745472 0.449632 -0.221733 -0.67303 0.0901394 -0.365342
0.350109 0.412389 0.22772 -0.743153 0.374894 -0.674853 -0.940435 0.284267
0.0780486 0.00241877 -0.793647 -0.801883 -0.931572 -0.906159 -0.325908 0.129096
0.251037 -0.32573 -0.0132674 0.16178 -0.391019 0.541115 0.186404 0.804935
-0.457725 0.0676978 -0.679403 -0.287371 -0.0475436 -0.433919 -0.777655 -0.648854
-0.0915583 -0.911684 -0.450737 0.330562 0.51434 -0.989688 -0.394102 0.621241
-0.475504 -0.0645391 0.836504 0.636607 -0.294769 0.747648 -0.23722 0.750184
-0.767895 -0.446372 0.758335 -0.407514 -0.304965 0.551426 0.467747 0.962403
-0.550376 0.261992 0.65622 -0.274081 0.87838 0.931551 -0.329732 0.0551602
0.911471 0.324545 0.0503461 -0.796273 0.150228 0.760694 -0.428716 -0.677338
0.320243 0.908401 -0.406211 -0.0914938 -0.0383119 0.971036 -0.996626 -0.420682
-0.632748 0.159697 0.350173 0.188661 -0.463423 -0.79209 -0.321071 -0.849934
-0.493952 0.59222 -0.239915 0.0675535 -0.209439 -0.896104 0.215966 -0.804748
0.470257 -0.814033 0.0936659 -0.279521 0.631632 -0.00510561 -0.694679 -0.554847
0.0193325 -0.515019 -0.502347 -0.0691725 0.0823693 0.218677 0.484909 0.230698
0.411173 -0.360974 -0.0687193 0.982974 -0.62282 -0.808528 0.391168 0.509953
-0.123533 0.573365 0.918135 -0.570049 0.0766659 0.916687 -0.189227 0.105294
-0.436078 0.565401 0.107861 -0.321394 -0.681098 0.372357 -0.911342 -0.836162
0.20572 0.550261 -0.578777 -0.236365 -0.582914 0.473617 -0.745445 -0.401362
-0.268776 -0.00963149 -0.870677 -0.315329 -0.327188 0.571639 -0.922104 -0.889744
-0.653846 0.42571 0.484338 0.786735 -0.924095 -0.777902 0.424617 -0.11099
0.314249 -0.488492 -0.09607 -0.285476 -0.257726 -0.803911 -0.806167 0.4756
-0.41036 -0.669857 -0.36997 0.551767 -0.906633 0.189437 -0.684472 -0.449454
-0.813612 -0.0906479 0.286132 0.680878 0.675851 0.0646878 -0.2403 -0.310925
-0.685114 0.0677462 -0.95481 -0.179017 0.857301 -0.87579 -0.329674 0.562246
0.0735071 -0.575949 0.50454 -0.686882 -0.0657996 0.874931 0.927272 -0.333088
-0.245092 -0.109308 -0.713837 -0.613438 -0.0236157 0.140357 -0.512282 -0.518118
0.184375 -0.865972 0.707001 -0.612003 0.67617 -0.709794 -0.885369 0.826005
-0.157901 0.836454 0.245372 0.589479 -0.930075 0.106183 0.420879 -0.510301
-0.466877 -0.115361 -0.736242 0.493482 -0.785855 -0.55306 0.617798 -0.904856
-0.830296 0.557992 -0.204564 -0.500123 0.153565 -0.773108 0.287265 0.823092
0.986858 -0.323913 -0.914362 0.535652 -0.535098 -0.945814 0.974316 0.434805
0.732686 0.221111 0.559403 0.584674 -0.447866 0.508206 0.907212 -0.782827
-0.970814 -0.13434 -0.550199 0.523038 -0.373701 -0.359454 0.0321578 0.840907
-21
View File
@@ -1,21 +0,0 @@
validate on
stats query_stats
dim 8
data_size 5000
read_data_pts test2-data.pts
query_size 100
read_query_pts test2-query.pts
bucket_size 1
near_neigh 3
split_rule suggest
shrink_rule none
build_ann
epsilon 0.0
run_queries standard
run_queries priority
epsilon 0.10
run_queries standard
run_queries priority
epsilon 0.50
run_queries standard
run_queries priority
-156
View File
@@ -1,156 +0,0 @@
------------------------------------------------------------
ann_test: Version 1.0
Copyright: David M. Mount and Sunil Arya.
Latest Revision: Mar 1, 2005.
------------------------------------------------------------
validate = on (Warning: this may slow execution time.)
stats = query_stats
[Read Data Points:
data_size = 5000
file_name = test2-data.pts
dim = 8
]
[Read Query Points:
query_size = 100
file_name = test2-query.pts
dim = 8
]
[Build ann-structure:
split_rule = suggest
shrink_rule = none
data_size = 5000
dim = 8
bucket_size = 1
process_time = 0.18 sec
(Structure Statistics:
n_nodes = 9999 (opt = 10000, best if < 100000)
n_leaves = 5000 (0 contain no points)
n_splits = 4999
n_shrinks = 0
empty_leaves = 0 percent (best if < 50 percent)
depth = 17 (opt = 12, best if < 196)
avg_aspect_ratio = 2.03396 (best if < 20)
)
]
(Computing true nearest neighbors for validation. This may take time.)
[Run Queries:
query_size = 100
dim = 8
search_method = standard
epsilon = 0
near_neigh = 3
true_nn = 13
query_time = 0.0008 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 269.6 : 154.1 ]< 68 , 1046 >
splitting_nodes = [ 448.2 : 259.2 ]< 100 , 1858 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 717.8 : 412.6 ]< 168 , 2904 >
points_visited = [ 269.6 : 154.1 ]< 68 , 1046 >
coord_hits/pt = [ 0.1975 : 0.1075 ]< 0.0446 , 0.6974 >
floating_ops_(K) = [ 8.492 : 4.716 ]< 1.939 , 32.61 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 100
dim = 8
search_method = priority
epsilon = 0
near_neigh = 3
true_nn = 13
query_time = 0.0011 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 237.7 : 131.6 ]< 68 , 801 >
splitting_nodes = [ 408.1 : 227.7 ]< 100 , 1398 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 645.8 : 358.5 ]< 168 , 2149 >
points_visited = [ 237.7 : 131.6 ]< 68 , 801 >
coord_hits/pt = [ 0.1679 : 0.08993 ]< 0.0472 , 0.5492 >
floating_ops_(K) = [ 10.83 : 6.344 ]< 2.638 , 38.3 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 100
dim = 8
search_method = standard
epsilon = 0.1
near_neigh = 3
true_nn = 13
query_time = 0.0006 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 200.9 : 115.8 ]< 51 , 762 >
splitting_nodes = [ 344.9 : 202.4 ]< 77 , 1407 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 545.9 : 317.4 ]< 128 , 2169 >
points_visited = [ 200.9 : 115.8 ]< 51 , 762 >
coord_hits/pt = [ 0.1548 : 0.08517 ]< 0.0348 , 0.5494 >
floating_ops_(K) = [ 6.606 : 3.703 ]< 1.513 , 25.14 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 100
dim = 8
search_method = priority
epsilon = 0.1
near_neigh = 3
true_nn = 13
query_time = 0.0007 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 176.1 : 101.1 ]< 49 , 629 >
splitting_nodes = [ 314.3 : 186.9 ]< 77 , 1285 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 490.4 : 286.6 ]< 128 , 1914 >
points_visited = [ 176.1 : 101.1 ]< 49 , 629 >
coord_hits/pt = [ 0.1309 : 0.07112 ]< 0.0374 , 0.4332 >
floating_ops_(K) = [ 8.205 : 4.999 ]< 2.032 , 33.27 >
average_error = [ 0 : 0 ]< 0 , 0 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 100
dim = 8
search_method = standard
epsilon = 0.5
near_neigh = 3
true_nn = 13
query_time = 0.0002 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 83.07 : 46.06 ]< 23 , 264 >
splitting_nodes = [ 163.4 : 94.86 ]< 42 , 512 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 246.5 : 140.2 ]< 67 , 776 >
points_visited = [ 83.07 : 46.06 ]< 23 , 264 >
coord_hits/pt = [ 0.0765 : 0.03992 ]< 0.0182 , 0.2192 >
floating_ops_(K) = [ 3.224 : 1.734 ]< 0.891 , 9.572 >
average_error = [ 0.0009039 : 0.009619 ]< 0 , 0.1516 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
[Run Queries:
query_size = 100
dim = 8
search_method = priority
epsilon = 0.5
near_neigh = 3
true_nn = 13
query_time = 0.0004 sec/query (biased by perf measurements)
(Performance stats: [ mean : stddev ]< min , max >
leaf_nodes = [ 69.72 : 38.29 ]< 21 , 246 >
splitting_nodes = [ 146.8 : 81.69 ]< 40 , 475 >
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
total_nodes = [ 216.5 : 118.8 ]< 65 , 721 >
points_visited = [ 69.72 : 38.29 ]< 21 , 246 >
coord_hits/pt = [ 0.06206 : 0.03155 ]< 0.0182 , 0.194 >
floating_ops_(K) = [ 3.608 : 1.989 ]< 1.126 , 12.28 >
average_error = [ 0.001425 : 0.011 ]< 0 , 0.1516 >
rank_error = [ 0 : 0 ]< 0 , 0 >
)
]
-31
View File
@@ -3,39 +3,8 @@ if(BUILD_CAM)
add_subdirectory(ANN)
endif(BUILD_CAM)
if(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
if(FREECAD_LIBPACK_CHECKFILE6X)
add_subdirectory(Pivy)
elseif(FREECAD_LIBPACK_CHECKFILE7X)
add_subdirectory(Pivy-0.5)
#elseif(BUILD_GUI AND FREECAD_LIBPACK_CHECKCUSTOM)
# find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
# if (COIN_VERSION3)
# add_subdirectory(Pivy-0.5)
# else (COIN_VERSION3)
# add_subdirectory(Pivy)
# endif(COIN_VERSION3)
#endif(BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
#if (MINGW)
# add_subdirectory(Pivy)
#endif(MINGW)
# applies for Unix, MinGW and Windows with custom LibPack
else(FREECAD_LIBPACK_CHECKFILE6X)
find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
if (COIN_VERSION3)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
add_subdirectory(Pivy-0.5)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
else (COIN_VERSION3)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
add_subdirectory(Pivy)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
endif(COIN_VERSION3)
endif (FREECAD_LIBPACK_CHECKFILE6X)
endif(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
# Build SalomeMesh for all Platforms since heavily patched
if (BUILD_SMESH AND NOT FREECAD_USE_EXTERNAL_SMESH)
add_subdirectory(salomesmesh)
endif()

Some files were not shown because too many files have changed in this diff Show More