Merge branch 'master' into HEAD

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5437 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
jriegel 2012-02-23 07:23:09 +00:00
commit 110119b4c3
108 changed files with 15255 additions and 52021 deletions

2
.gitattributes vendored
View File

@ -14,3 +14,5 @@ UpdateResources.bat export-ignore
BuildVersion.bat export-ignore
*.sln export-ignore
WindowsInstaller export-ignore
Version.h.in export-subst

View File

@ -56,15 +56,28 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
# ================================================================================
# Output directories for install target
if(WIN32)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installation root directory")
else(WIN32)
SET(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad")
SET(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad" CACHE PATH "Installation root directory")
SET(INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif(WIN32)
SET(CMAKE_INSTALL_DATADIR data CACHE PATH "Output directory for data and resource files")
SET(CMAKE_INSTALL_INCLUDEDIR include CACHE PATH "Output directory for header files")
SET(CMAKE_INSTALL_DOCDIR doc CACHE PATH "Output directory for documentation and license files")
# used as compiler defines
SET(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}")
SET(DOCDIR "${CMAKE_INSTALL_DOCDIR}")
MESSAGE("prefix: ${CMAKE_INSTALL_PREFIX}")
MESSAGE("datadir: ${CMAKE_INSTALL_DATADIR}")
MESSAGE("docdir: ${CMAKE_INSTALL_DOCDIR}")
MESSAGE("includedir: ${CMAKE_INSTALL_INCLUDEDIR}")
# ==============================================================================
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
if(MSVC)
@ -83,8 +96,7 @@ OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3
OPTION(FREECAD_BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
OPTION(FREECAD_BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
OPTION(FREECAD_BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
SET(RESOURCEDIR "${CMAKE_INSTALL_PREFIX}/data" CACHE PATH "Absolute path to the data directory.")
SET(DOCDIR "" CACHE PATH "Absolute path to the documentation directory.")
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
# ==============================================================================
@ -443,7 +455,6 @@ if(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
"Makefile$"
"\\\\.sh$"
"_CPack_"
"71"
"config.h$"
"config.log$"
"config.status$"
@ -467,6 +478,7 @@ if(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
#ADD_CUSTOM_TARGET(DIST make package_source)
endif(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
#add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
add_custom_target(dist-git
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR}

View File

@ -30,7 +30,7 @@ fi
if which glibtoolize > /dev/null 2>&1; then
echo "calling glibtoolize"
glibtoolize --force --copy
elif which libtoolize > /dev/null 2>71; then
elif which libtoolize > /dev/null 2>&1; then
echo "calling libtoolize"
libtoolize --force --copy
else

View File

@ -38,37 +38,9 @@ ENDFOREACH(SRC ${FILES})
SET(${TARGETS} ${AddTargets})
ENDMACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR FILES TARGETS TAGS)
MACRO (fc_copy_to_mod_path mod_name )
FOREACH (it ${ARGN})
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${it}" NATIVE_SOURCE)
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/Mod/${mod_name}/" NATIVE_DEST)
message(STATUS "${PLATFORM_CP} ${NATIVE_SOURCE} ${NATIVE_DEST}")
if (WIN32)
else (WIN32)
execute_process( COMMAND ${PLATFORM_MK} ${NATIVE_DEST} )
endif (WIN32)
execute_process( COMMAND ${PLATFORM_CP} ${NATIVE_SOURCE} ${NATIVE_DEST} )
ENDFOREACH(it)
ENDMACRO(fc_copy_to_mod_path)
MACRO (fc_copy_to_path path_name)
FOREACH (it ${ARGN})
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${it}" NATIVE_SOURCE)
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${path_name}/" NATIVE_DEST)
message(STATUS "${PLATFORM_CP} ${NATIVE_SOURCE} ${NATIVE_DEST}")
if (WIN32)
else (WIN32)
execute_process( COMMAND ${PLATFORM_MK} ${NATIVE_DEST} )
endif (WIN32)
execute_process( COMMAND ${PLATFORM_CP} ${NATIVE_SOURCE} ${NATIVE_DEST} )
ENDFOREACH(it)
ENDMACRO(fc_copy_to_path)
MACRO (fc_copy_sources path_name mod_name)
MACRO (fc_copy_sources target_name outpath)
foreach(it ${ARGN})
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${path_name}/${it}" outfile)
file(TO_NATIVE_PATH "${outpath}/${it}" outfile)
get_filename_component(infile ${it} ABSOLUTE)
get_filename_component(outfile ${outfile} ABSOLUTE)
add_file_dependencies(${infile} ${outfile})
@ -76,42 +48,21 @@ MACRO (fc_copy_sources path_name mod_name)
SOURCE ${infile}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${infile} ${outfile}
TARGET ${mod_name}
TARGET ${target_name}
OUTPUTS ${outfile}
)
endforeach(it)
ADD_CUSTOM_COMMAND(
SOURCE ${mod_name}
TARGET ${mod_name}
SOURCE ${target_name}
TARGET ${target_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_copy_sources)
MACRO (fc_copy_sources_outpath out_path mod_name)
MACRO (fc_target_copy_resource target_name inpath outpath)
foreach(it ${ARGN})
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${out_path}/${it}" outfile)
get_filename_component(infile ${it} ABSOLUTE)
get_filename_component(outfile ${outfile} ABSOLUTE)
add_file_dependencies(${infile} ${outfile})
ADD_CUSTOM_COMMAND(
SOURCE ${infile}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${infile} ${outfile}
TARGET ${mod_name}
OUTPUTS ${outfile}
)
endforeach(it)
ADD_CUSTOM_COMMAND(
SOURCE ${mod_name}
TARGET ${mod_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_copy_sources_outpath)
MACRO (fc_copy_script path_name mod_name)
foreach(it ${ARGN})
file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}/src/${path_name}/${it}" infile)
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/${path_name}/${it}" outfile)
file(TO_NATIVE_PATH "${inpath}/${it}" infile)
file(TO_NATIVE_PATH "${outpath}/${it}" outfile)
get_filename_component(infile ${infile} ABSOLUTE)
get_filename_component(outfile ${outfile} ABSOLUTE)
add_file_dependencies(${infile} ${outfile})
@ -119,16 +70,16 @@ MACRO (fc_copy_script path_name mod_name)
SOURCE ${infile}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${infile} ${outfile}
TARGET ${mod_name}
TARGET ${target_name}
OUTPUTS ${outfile}
)
endforeach(it)
ADD_CUSTOM_COMMAND(
SOURCE ${mod_name}
TARGET ${mod_name}
SOURCE ${target_name}
TARGET ${target_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_copy_script)
ENDMACRO(fc_target_copy_resource)
macro(copy_to_local_output_paths SOURCE_PATHS)
if(CMAKE_CFG_INTDIR STREQUAL .)

View File

@ -1 +1,9 @@
add_subdirectory(examples)
INSTALL(
FILES
License.txt
DESTINATION
${CMAKE_INSTALL_DATADIR}
)

View File

@ -2,6 +2,7 @@
SET(Examples_Files
Schenkel.stp
DrawingExample.FCStd
EngineBlock.FCStd
PartDesignExample.FCStd
RobotExample.FCStd
)
@ -10,12 +11,12 @@ ADD_CUSTOM_TARGET(Example_data ALL
SOURCES ${Examples_Files}
)
fc_copy_sources("data/examples" "Examples" ${Examples_Files})
fc_copy_sources(Examples "${CMAKE_BINARY_DIR}/data/examples" ${Examples_Files})
INSTALL(
FILES
${Examples_Files}
DESTINATION
data/examples
${CMAKE_INSTALL_DATADIR}/examples
)

View File

@ -20,16 +20,18 @@ elseif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE7X)
#endif(MINGW)
# applies for Unix, MinGW and Windows with custom LibPack
elseif(FREECAD_BUILD_GUI)
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)
if (NOT FREECAD_BUILD_DEBIAN)
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 (NOT FREECAD_BUILD_DEBIAN)
endif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
# For Windows we have all stuff in the LibPack

View File

@ -56,15 +56,16 @@ else(MSVC)
set_target_properties(coin PROPERTIES OUTPUT_NAME "_coin")
set_target_properties(coin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/pivy)
set_target_properties(coin PROPERTIES PREFIX "")
install(TARGETS coin DESTINATION bin/pivy)
set_target_properties(coin PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/bin/pivy)
endif(MSVC)
fc_copy_sources_outpath("bin/pivy" "coin"
fc_copy_sources(coin "${CMAKE_BINARY_DIR}/bin/pivy"
__init__.py
coin.py
sogui.py
)
install(TARGETS coin DESTINATION bin/pivy)
install(FILES __init__.py coin.py sogui.py DESTINATION bin/pivy)
########################### SoQtPy ###########################
@ -113,11 +114,13 @@ else(MSVC)
set_target_properties(soqt PROPERTIES OUTPUT_NAME "_soqt")
set_target_properties(soqt PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/pivy/gui)
set_target_properties(soqt PROPERTIES PREFIX "")
set_target_properties(soqt PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/bin/pivy/gui)
endif(MSVC)
fc_copy_sources_outpath("bin/pivy" "soqt"
fc_copy_sources(soqt "${CMAKE_BINARY_DIR}/bin/pivy"
gui/soqt.py
gui/__init__.py
)
install(FILES __init__.py soqt.py DESTINATION bin/pivy/gui)
install(TARGETS soqt DESTINATION bin/pivy/gui)
install(FILES gui/__init__.py soqt.py DESTINATION bin/pivy/gui)

View File

@ -56,14 +56,16 @@ else(MSVC)
set_target_properties(coin PROPERTIES OUTPUT_NAME "_coin")
set_target_properties(coin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/pivy)
set_target_properties(coin PROPERTIES PREFIX "")
set_target_properties(coin PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/bin/pivy)
endif(MSVC)
fc_copy_sources_outpath("bin/pivy" "coin"
fc_copy_sources(coin "${CMAKE_BINARY_DIR}/bin/pivy"
__init__.py
coin.py
sogui.py
)
install(TARGETS coin DESTINATION bin/pivy)
install(FILES __init__.py coin.py sogui.py DESTINATION bin/pivy)
########################### SoQtPy ###########################
@ -112,11 +114,13 @@ else(MSVC)
set_target_properties(soqt PROPERTIES OUTPUT_NAME "_soqt")
set_target_properties(soqt PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/pivy/gui)
set_target_properties(soqt PROPERTIES PREFIX "")
set_target_properties(soqt PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/bin/pivy/gui)
endif(MSVC)
fc_copy_sources_outpath("bin/pivy" "soqt"
fc_copy_sources(soqt "${CMAKE_BINARY_DIR}/bin/pivy"
gui/soqt.py
gui/__init__.py
)
install(FILES __init__.py gui/soqt.py DESTINATION bin/pivy/gui)
install(TARGETS soqt DESTINATION bin/pivy/gui)
install(FILES gui/__init__.py gui/soqt.py DESTINATION bin/pivy/gui)

View File

@ -102,6 +102,7 @@
#include <boost/signals.hpp>
#include <boost/bind.hpp>
#include <boost/version.hpp>
#include <QDir>
using namespace App;
using namespace std;
@ -481,8 +482,14 @@ std::string Application::getUserAppDataDir()
std::string Application::getResourceDir()
{
# ifdef RESOURCEDIR
return std::string(RESOURCEDIR) + "/";
#ifdef RESOURCEDIR
std::string path(RESOURCEDIR);
path.append("/");
QDir dir(QString::fromUtf8(RESOURCEDIR));
if (dir.isAbsolute())
return path;
else
return mConfig["AppHomePath"] + path;
#else
return mConfig["AppHomePath"];
#endif
@ -490,8 +497,14 @@ std::string Application::getResourceDir()
std::string Application::getHelpDir()
{
# ifdef DOCDIR
return std::string(DOCDIR) + "/";
#ifdef DOCDIR
std::string path(DOCDIR);
path.append("/");
QDir dir(QString::fromUtf8(DOCDIR));
if (dir.isAbsolute())
return path;
else
return mConfig["AppHomePath"] + path;
#else
return mConfig["DocPath"];
#endif

View File

@ -4,13 +4,13 @@ if(WIN32)
endif(WIN32)
# This causes some problems with the resource files to be found, especially with the StartPage
#IF(RESOURCEDIR)
# add_definitions(-DRESOURCEDIR="${RESOURCEDIR}")
#ENDIF(RESOURCEDIR)
IF(RESOURCEDIR)
add_definitions(-DRESOURCEDIR="${RESOURCEDIR}")
ENDIF(RESOURCEDIR)
#IF(DOCDIR)
# add_definitions(-DDOCDIR="${DOCDIR}")
#ENDIF(DOCDIR)
IF(DOCDIR)
add_definitions(-DDOCDIR="${DOCDIR}")
ENDIF(DOCDIR)
include_directories(
${CMAKE_BINARY_DIR}/src

View File

@ -68,7 +68,7 @@ if(SWIG_FOUND)
add_definitions(-DHAVE_SWIG=1)
endif(SWIG_FOUND)
if (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++)
if (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
SET(zipios_SRCS
../zipios++/backbuffer.h
../zipios++/basicentry.cpp
@ -122,12 +122,12 @@ SET(zipios_SRCS
../zipios++/zipoutputstream.h
)
SOURCE_GROUP("zipios" FILES ${zipios_SRCS})
else (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++)
else (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
set(FreeCADBase_LIBS
${FreeCADBase_LIBS}
-lzipios
)
endif (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++)
endif (EXISTS ${CMAKE_SOURCE_DIR}/src/zipios++ AND NOT FREECAD_BUILD_DEBIAN)
SET(pycxx_SRCS
../CXX/Config.hxx

View File

@ -218,6 +218,28 @@ _Precision Vector3<_Precision>::DistanceToLine (const Vector3<_Precision> &rclBa
return (_Precision) fabs((rclDirect % Vector3(*this - rclBase)).Length() / rclDirect.Length());
}
template <class _Precision>
Vector3<_Precision> Vector3<_Precision>::DistanceToLineSegment (const Vector3& rclP1,
const Vector3& rclP2) const
{
Vector3<_Precision> dir = rclP2-rclP1;
Vector3<_Precision> beg = *this-rclP1;
Vector3<_Precision> end = beg+dir;
Vector3<_Precision> proj, len;
proj.ProjToLine(beg, dir);
len = proj + beg;
if (len * dir < 0 || len.Length() > dir.Length()) {
if (beg.Length() < end.Length())
return beg;
else
return end;
}
else {
return proj;
}
}
template <class _Precision>
Vector3<_Precision>& Vector3<_Precision>::ProjToLine (const Vector3<_Precision> &rclPoint,
const Vector3<_Precision> &rclLine)

View File

@ -180,6 +180,12 @@ public:
_Precision DistanceToPlane (const Vector3 &rclBase, const Vector3 &rclNorm) const;
/// Computes the distance from this point to the line given by \a rclBase and \a rclDirect.
_Precision DistanceToLine (const Vector3 &rclBase, const Vector3 &rclDirect) const;
/** Computes the vector from this point to the point on the line segment with the shortest
* distance. The line segment is defined by \a rclP1 and \a rclP2.
* Note: If the projection of this point is outside the segment then the shortest distance
* to \a rclP1 or \a rclP2 is computed.
*/
Vector3 DistanceToLineSegment (const Vector3& rclP1, const Vector3& rclP2) const;
//@}
};

View File

@ -3,7 +3,7 @@
#define FCVersionMajor "0"
#define FCVersionMinor "13"
#define FCVersionName "Vulcan"
// test: $Format:Hash (%H), Date: %ci$
#define FCRevision "$WCREV$" //Highest committed revision number
#define FCRevisionDate "$WCDATE$" //Date of highest committed revision
#define FCRepositoryURL "$WCURL$" //Repository URL of the working copy

View File

@ -12,10 +12,15 @@ if(FREECAD_BUILD_GUI)
configure_file(Doc/freecad.qch ${CMAKE_BINARY_DIR}/doc/freecad.qch COPYONLY)
endif(FREECAD_BUILD_GUI)
#if(FREECAD_MAINTAINERS_BUILD)
if(FREECAD_MAINTAINERS_BUILD)
add_subdirectory(Doc)
#endif(FREECAD_MAINTAINERS_BUILD)
endif(FREECAD_MAINTAINERS_BUILD)
if(FREECAD_MAINTAINERS_BUILD AND WIN32)
#add_subdirectory(WindowsInstaller)
endif(FREECAD_MAINTAINERS_BUILD AND WIN32)
INSTALL(FILES Doc/Start_Page.html Doc/freecad.qhc Doc/freecad.qch
DESTINATION ${CMAKE_INSTALL_DOCDIR}
)

View File

@ -257,17 +257,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
this->button3down = press;
break;
case SoMouseButtonEvent::BUTTON4:
if (this->invertZoom)
zoom(viewer->getCamera(), -0.05f);
else
zoom(viewer->getCamera(), 0.05f);
doZoom(viewer->getCamera(), TRUE, posn);
processed = TRUE;
break;
case SoMouseButtonEvent::BUTTON5:
if (this->invertZoom)
zoom(viewer->getCamera(), 0.05f);
else
zoom(viewer->getCamera(), -0.05f);
doZoom(viewer->getCamera(), FALSE, posn);
processed = TRUE;
break;
default:

View File

@ -286,17 +286,11 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
this->button3down = press;
break;
case SoMouseButtonEvent::BUTTON4:
if (this->invertZoom)
zoom(viewer->getCamera(), -0.05f);
else
zoom(viewer->getCamera(), 0.05f);
doZoom(viewer->getCamera(), TRUE, posn);
processed = TRUE;
break;
case SoMouseButtonEvent::BUTTON5:
if (this->invertZoom)
zoom(viewer->getCamera(), 0.05f);
else
zoom(viewer->getCamera(), -0.05f);
doZoom(viewer->getCamera(), FALSE, posn);
processed = TRUE;
break;
default:

View File

@ -848,4 +848,8 @@ else(WIN32)
INSTALL(TARGETS FreeCADGui
LIBRARY DESTINATION lib
)
INSTALL(FILES Icons/freecad.xpm Icons/freecad-doc.png
DESTINATION ${CMAKE_INSTALL_DATADIR}
)
endif(WIN32)

View File

@ -52,6 +52,8 @@
#include "Placement.h"
#include "WaitCursor.h"
#include "ViewProvider.h"
#include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h>
#include "MergeDocuments.h"
using namespace Gui;
@ -1022,6 +1024,46 @@ bool StdCmdPlacement::isActive(void)
return (Gui::Control().activeDialog()==0);
}
//===========================================================================
// Std_Edit
//===========================================================================
DEF_STD_CMD_A(StdCmdEdit);
StdCmdEdit::StdCmdEdit()
:Command("Std_Edit")
{
sGroup = QT_TR_NOOP("Edit");
sMenuText = QT_TR_NOOP("Toggle &Editmode");
sToolTipText = QT_TR_NOOP("Toggles the selected object's edit mode");
sWhatsThis = "Std_Edit";
sStatusTip = QT_TR_NOOP("Enters or leaves the selected object's edit mode");
#if QT_VERSION >= 0x040200
sPixmap = "edit-edit";
#endif
eType = ForEdit;
}
void StdCmdEdit::activated(int iMsg)
{
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
if (viewer->isEditingViewProvider()) {
doCommand(Command::Gui,"Gui.activeDocument().resetEdit()");
} else {
if (Selection().getCompleteSelection().size() > 0) {
SelectionSingleton::SelObj obj = Selection().getCompleteSelection()[0];
doCommand(Command::Gui,"Gui.activeDocument().setEdit(\"%s\",0)",obj.FeatName);
}
}
}
}
bool StdCmdEdit::isActive(void)
{
return (Selection().getCompleteSelection().size() > 0) || (Gui::Control().activeDialog() != 0);
}
namespace Gui {
@ -1054,6 +1096,7 @@ void CreateDocCommands(void)
rcCmdMgr.addCommand(new StdCmdRefresh());
rcCmdMgr.addCommand(new StdCmdTransform());
rcCmdMgr.addCommand(new StdCmdPlacement());
rcCmdMgr.addCommand(new StdCmdEdit());
}
} // namespace Gui

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>477</width>
<height>442</height>
<height>495</height>
</rect>
</property>
<property name="windowTitle">
@ -25,7 +25,7 @@
<property name="title">
<string>3D View settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="CheckBox_CornerCoordSystem">
<property name="text">
@ -130,6 +130,65 @@
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxZoomAtCursor">
<property name="text">
<string>Zoom at cursor</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ZoomAtCursor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Zoom step</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="spinBoxZoomStep">
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.050000000000000</double>
</property>
<property name="value">
<double>0.050000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ZoomStep</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxInvertZoom">
<property name="text">
<string>Invert zoom</string>
@ -142,7 +201,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxAntiAliasing">
<property name="text">
<string>Enable anti-aliasing (slower)</string>
@ -155,7 +214,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="Line" name="line1">
<property name="frameShape">
<enum>QFrame::HLine</enum>
@ -168,7 +227,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<layout class="QHBoxLayout" name="eyedistanceLayout">
<property name="spacing">
<number>6</number>
@ -210,7 +269,7 @@
</item>
</layout>
</item>
<item row="8" column="0">
<item row="9" column="0">
<layout class="QGridLayout" name="backlightLayout">
<property name="margin">
<number>11</number>
@ -399,6 +458,8 @@
<tabstop>comboNavigationStyle</tabstop>
<tabstop>mouseButton</tabstop>
<tabstop>comboOrbitStyle</tabstop>
<tabstop>checkBoxZoomAtCursor</tabstop>
<tabstop>spinBoxZoomStep</tabstop>
<tabstop>checkBoxInvertZoom</tabstop>
<tabstop>checkBoxAntiAliasing</tabstop>
<tabstop>FloatSpinBox_EyeDistance</tabstop>

View File

@ -72,7 +72,9 @@ void DlgSettings3DViewImp::saveSettings()
int index = comboOrbitStyle->currentIndex();
hGrp->SetInt("OrbitStyle", index);
checkBoxZoomAtCursor->onSave();
checkBoxInvertZoom->onSave();
spinBoxZoomStep->onSave();
checkBoxAntiAliasing->onSave();
CheckBox_CornerCoordSystem->onSave();
CheckBox_ShowFPS->onSave();
@ -87,7 +89,9 @@ void DlgSettings3DViewImp::saveSettings()
void DlgSettings3DViewImp::loadSettings()
{
checkBoxZoomAtCursor->onRestore();
checkBoxInvertZoom->onRestore();
spinBoxZoomStep->onRestore();
checkBoxAntiAliasing->onRestore();
CheckBox_CornerCoordSystem->onRestore();
CheckBox_ShowFPS->onRestore();

149
src/Gui/Icons/edit-edit.svg Normal file
View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg4025"
version="1.1"
inkscape:version="0.48.1 r9760"
sodipodi:docname="edit-edit.svg">
<defs
id="defs4027">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="32 : 16 : 1"
inkscape:persp3d-origin="16 : 10.666667 : 1"
id="perspective4033" />
<inkscape:perspective
id="perspective4010"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4095"
id="linearGradient3999"
gradientUnits="userSpaceOnUse"
x1="901.1875"
y1="1190.875"
x2="1267.9062"
y2="1190.875"
gradientTransform="matrix(0.10456791,0,0,0.10456791,420.90006,31.02362)" />
<linearGradient
id="linearGradient4095">
<stop
style="stop-color:#0044be;stop-opacity:1;"
offset="0"
id="stop4097" />
<stop
style="stop-color:#2b90cc;stop-opacity:1;"
offset="1"
id="stop4099" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4095"
id="linearGradient2979"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.13878644,0,0,0.1266123,-121.41255,-154.04118)"
x1="901.1875"
y1="1190.875"
x2="1267.9062"
y2="1190.875" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.9795105"
inkscape:cx="-43.110306"
inkscape:cy="48.878745"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1280"
inkscape:window-height="757"
inkscape:window-x="0"
inkscape:window-y="20"
inkscape:window-maximized="1" />
<metadata
id="metadata4030">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,32)">
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000621;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 50.997977,1.1344967 3.432738,3.3992652 c 0,0 1.210331,6.8306391 1.815497,10.2459571 0.605165,3.415319 1.815494,10.245958 1.815494,10.245958 0,0 -7.757014,-1.057726 -11.316388,-1.815656 -3.559372,-0.757933 -10.039854,-2.731932 -10.039854,-2.731932 l -4.999305,-4.90932"
id="path3385-6"
sodipodi:nodetypes="cczczcc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/draft.png"
inkscape:export-xdpi="6.2926431"
inkscape:export-ydpi="6.2926431"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient2979);fill-opacity:1;fill-rule:evenodd;stroke:#000621;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 22.71718,-26.934304 c 0,0 -6.207288,-0.559419 -12.046285,5.299332 -5.8389965,5.858751 -6.3169063,10.151334 -6.3169063,10.151334 L 36.600148,20.410791 c -0.276624,-0.52502 -0.429376,-1.105486 -0.429376,-1.717188 0,-2.329777 1.221359,-4.975527 3.968622,-4.975527 0.743862,0 1.44788,0.139443 2.081797,0.387739 l 0.299267,-0.253217 c -0.09276,-0.321979 -0.143125,-0.659396 -0.143125,-1.004974 0,-2.329801 2.47993,-4.4743223 5.227207,-4.4743223 0.422165,0 0.831524,0.046264 1.223062,0.1305676 l 1.040912,-0.8744134 c -0.05799,-0.256209 -0.09104,-0.5210491 -0.09104,-0.7913281 0,-1.8379317 3.033164,-1.5039843 4.968355,-2.082003 L 22.717225,-26.934304 z"
id="rect2390-8"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/draft.png"
inkscape:export-xdpi="6.2926431"
inkscape:export-ydpi="6.2926431"
sodipodi:nodetypes="czccssccssccsccc"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000621;stroke-width:1.32559693;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 48.544883,7.6133709 15.050897,-24.733532"
id="path3373-7"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/draft.png"
inkscape:export-xdpi="6.2926431"
inkscape:export-ydpi="6.2926431"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000621;stroke-width:1.32559693;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 41.787708,13.237662 9.4859605,-19.489738"
id="path3375-9"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/draft.png"
inkscape:export-xdpi="6.2926431"
inkscape:export-ydpi="6.2926431"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:#000621;fill-opacity:1;fill-rule:evenodd;stroke:#000621;stroke-width:0.13255970000000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 56.215108,14.884285 c 0,0 -3.733918,2.191368 -5.205971,3.44903 -1.472051,1.257659 -3.626343,4.096932 -3.626343,4.096932 l 11.075451,2.557967 -2.243137,-10.103929 z"
id="path3387-0"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/draft.png"
inkscape:export-xdpi="6.2926431"
inkscape:export-ydpi="6.2926431"
sodipodi:nodetypes="czccc"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -45,6 +45,7 @@
<file>edit-select-all.svg</file>
<file>edit-redo.svg</file>
<file>edit-undo.svg</file>
<file>edit-edit.svg</file>
<file>help-browser.svg</file>
<file>preferences-system.svg</file>
<file>window-new.svg</file>

View File

@ -251,17 +251,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
this->button3down = press;
break;
case SoMouseButtonEvent::BUTTON4:
if (this->invertZoom)
zoom(viewer->getCamera(), -0.05f);
else
zoom(viewer->getCamera(), 0.05f);
doZoom(viewer->getCamera(), TRUE, posn);
processed = TRUE;
break;
case SoMouseButtonEvent::BUTTON5:
if (this->invertZoom)
zoom(viewer->getCamera(), 0.05f);
else
zoom(viewer->getCamera(), -0.05f);
doZoom(viewer->getCamera(), FALSE, posn);
processed = TRUE;
break;
default:

View File

@ -197,15 +197,19 @@ namespace Gui {
public:
PythonRedirector(const char* type, PyObject* obj) : std_out(type), out(obj)
{
Base::PyGILStateLocker lock;
old = PySys_GetObject(const_cast<char*>(std_out));
PySys_SetObject(const_cast<char*>(std_out), obj);
if (out) {
Base::PyGILStateLocker lock;
old = PySys_GetObject(const_cast<char*>(std_out));
PySys_SetObject(const_cast<char*>(std_out), out);
}
}
~PythonRedirector()
{
Base::PyGILStateLocker lock;
PySys_SetObject(const_cast<char*>(std_out), old);
Py_XDECREF(out);
if (out) {
Base::PyGILStateLocker lock;
PySys_SetObject(const_cast<char*>(std_out), old);
Py_DECREF(out);
}
}
private:
const char* std_out;
@ -217,8 +221,12 @@ namespace Gui {
void MacroManager::run(MacroType eType,const char *sName)
{
try {
PythonRedirector std_out("stdout",new OutputStdout);
PythonRedirector std_err("stderr",new OutputStderr);
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("OutputWindow");
PyObject* pyout = hGrp->GetBool("RedirectPythonOutput") ? new OutputStdout : 0;
PyObject* pyerr = hGrp->GetBool("RedirectPythonErrors") ? new OutputStderr : 0;
PythonRedirector std_out("stdout",pyout);
PythonRedirector std_err("stderr",pyerr);
//The given path name is expected to be Utf-8
Base::Interpreter().runFile(sName, true);
}

View File

@ -36,6 +36,7 @@
# include <QLabel>
# include <QMdiSubWindow>
# include <QMessageBox>
# include <QPainter>
# include <QSettings>
# include <QSignalMapper>
# include <QStatusBar>
@ -1303,6 +1304,44 @@ QPixmap MainWindow::splashImage() const
splash_image.load(fi.filePath(), "PNG");
if (splash_image.isNull())
splash_image = Gui::BitmapFactory().pixmap(App::Application::Config()["SplashPicture"].c_str());
// include application name and version number
std::map<std::string,std::string>::const_iterator tc = App::Application::Config().find("SplashExeColor");
if (tc != App::Application::Config().end()) {
QString exeName = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString major = QString::fromAscii(App::Application::Config()["BuildVersionMajor"].c_str());
QString minor = QString::fromAscii(App::Application::Config()["BuildVersionMinor"].c_str());
QString version = QString::fromAscii("%1.%2").arg(major).arg(minor);
QPainter painter;
painter.begin(&splash_image);
QFont fontExe = painter.font();
fontExe.setPointSize(20);
QFontMetrics metricExe(fontExe);
int l = metricExe.width(exeName);
int w = splash_image.width();
int h = splash_image.height();
QFont fontVer = painter.font();
fontVer.setPointSize(12);
QFontMetrics metricVer(fontVer);
int v = metricVer.width(version);
QColor color;
color.setNamedColor(QString::fromAscii(tc->second.c_str()));
if (!color.isValid()) {
color.setRed(200);
color.setGreen(200);
color.setBlue(200);
}
painter.setPen(color);
painter.setFont(fontExe);
painter.drawText(w-(l+v+10),h-20, exeName);
painter.setFont(fontVer);
painter.drawText(w-(v+5),h-20, version);
painter.end();
}
return splash_image;
}

View File

@ -215,6 +215,10 @@ void NavigationStyle::initialize()
this->altdown = FALSE;
this->invertZoom = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",false);
this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View")->GetBool("ZoomAtCursor",false);
this->zoomStep = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View")->GetFloat("ZoomStep",0.05f);
}
void NavigationStyle::finalize()
@ -709,6 +713,33 @@ void NavigationStyle::zoomByCursor(const SbVec2f & thispos, const SbVec2f & prev
zoom(viewer->getCamera(), (thispos[1] - prevpos[1]) * 10.0f/*20.0f*/);
}
void NavigationStyle::doZoom(SoCamera* camera, SbBool forward, const SbVec2f& pos)
{
SbBool zoomAtCur = this->zoomAtCursor;
if (zoomAtCur) {
const SbViewportRegion & vp = viewer->getViewportRegion();
float ratio = vp.getViewportAspectRatio();
SbViewVolume vv = camera->getViewVolume(vp.getViewportAspectRatio());
SbPlane panplane = vv.getPlane(camera->focalDistance.getValue());
panCamera(viewer->getCamera(), ratio, panplane, SbVec2f(0.5,0.5), pos);
}
float value = this->zoomStep;
if (!forward)
value = -value;
if (this->invertZoom)
value = -value;
zoom(camera, value);
if (zoomAtCur) {
const SbViewportRegion & vp = viewer->getViewportRegion();
float ratio = vp.getViewportAspectRatio();
SbViewVolume vv = camera->getViewVolume(vp.getViewportAspectRatio());
SbPlane panplane = vv.getPlane(camera->focalDistance.getValue());
panCamera(viewer->getCamera(), ratio, panplane, pos, SbVec2f(0.5,0.5));
}
}
/** Uses the sphere sheet projector to map the mouseposition onto
* a 3D point and find a rotation from this and the last calculated point.
*/
@ -884,6 +915,21 @@ SbBool NavigationStyle::isZoomInverted() const
return this->invertZoom;
}
void NavigationStyle::setZoomStep(float val)
{
this->zoomStep = val;
}
void NavigationStyle::setZoomAtCursor(SbBool on)
{
this->zoomAtCursor = on;
}
SbBool NavigationStyle::isZoomAtCursor() const
{
return this->zoomAtCursor;
}
void NavigationStyle::startSelection(AbstractMouseSelection* mouse)
{
if (!mouse)

View File

@ -111,6 +111,9 @@ public:
void setZoomInverted(SbBool);
SbBool isZoomInverted() const;
void setZoomStep(float);
void setZoomAtCursor(SbBool);
SbBool isZoomAtCursor() const;
void updateAnimation();
void redraw();
@ -162,6 +165,7 @@ protected:
void panToCenter(const SbPlane & pplane, const SbVec2f & currpos);
void zoom(SoCamera * camera, float diffvalue);
void zoomByCursor(const SbVec2f & thispos, const SbVec2f & prevpos);
void doZoom(SoCamera * camera, SbBool forward, const SbVec2f& pos);
void spin(const SbVec2f & pointerpos);
SbBool doSpin();
@ -191,6 +195,8 @@ protected:
SbBool ctrldown, shiftdown, altdown;
SbBool button1down, button2down, button3down;
SbBool invertZoom;
SbBool zoomAtCursor;
float zoomStep;
/** @name Mouse model */
//@{

View File

@ -154,17 +154,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
this->setViewing(true);
break;
case SoKeyboardEvent::PAGE_UP:
if (this->invertZoom)
zoom(viewer->getCamera(), 0.05f);
else
zoom(viewer->getCamera(), -0.05f);
doZoom(viewer->getCamera(), TRUE, posn);
processed = TRUE;
break;
case SoKeyboardEvent::PAGE_DOWN:
if (this->invertZoom)
zoom(viewer->getCamera(), -0.05f);
else
zoom(viewer->getCamera(), 0.05f);
doZoom(viewer->getCamera(), FALSE, posn);
processed = TRUE;
break;
default:

View File

@ -276,6 +276,14 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
bool on = rGrp.GetBool("InvertZoom", false);
_viewer->navigationStyle()->setZoomInverted(on);
}
else if (strcmp(Reason,"ZoomAtCursor") == 0) {
bool on = rGrp.GetBool("ZoomAtCursor", false);
_viewer->navigationStyle()->setZoomAtCursor(on);
}
else if (strcmp(Reason,"ZoomSetp") == 0) {
float val = rGrp.GetFloat("ZoomSetp", 0.0f);
_viewer->navigationStyle()->setZoomStep(val);
}
else if (strcmp(Reason,"EyeDistance") == 0) {
_viewer->setStereoOffset(rGrp.GetFloat("EyeDistance",65.0));
}

View File

@ -440,7 +440,7 @@ MenuItem* StdWorkbench::setupMenuBar() const
*edit << "Std_Undo" << "Std_Redo" << "Separator" << "Std_Cut" << "Std_Copy"
<< "Std_Paste" << "Std_DuplicateSelection" << "Separator"
<< "Std_Refresh" << "Std_SelectAll" << "Std_Delete" << "Std_Placement"
<< "Separator" << "Std_DlgPreferences";
<< "Std_Edit" << "Separator" << "Std_DlgPreferences";
// Standard views
MenuItem* stdviews = new MenuItem;

View File

@ -276,6 +276,7 @@ int main( int argc, char ** argv )
//App::Application::Config()["HiddenDockWindow"] = "Property editor";
App::Application::Config()["SplashAlignment" ] = "Bottom|Left";
App::Application::Config()["SplashTextColor" ] = "#ffffff"; // white
App::Application::Config()["SplashExeColor" ] = "#c8c8c8"; // light grey
try {
// Init phase ===========================================================

View File

@ -340,10 +340,9 @@ class _AxisTaskPanel:
self.obj.Angles = a
FreeCAD.ActiveDocument.recompute()
def finish(self):
def accept(self):
self.resetObject()
if self.obj:
self.obj.ViewObject.finishEditing()
FreeCADGui.ActiveDocument.resetEdit()
def retranslateUi(self, TaskPanel):
TaskPanel.setWindowTitle(QtGui.QApplication.translate("Arch", "Axes", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -222,8 +222,7 @@ class ComponentTaskPanel:
def accept(self):
FreeCAD.ActiveDocument.recompute()
if self.obj:
self.obj.ViewObject.finishEditing()
FreeCADGui.ActiveDocument.resetEdit()
return True
def editObject(self,wid,col):
@ -308,7 +307,7 @@ class ViewProviderComponent:
def unsetEdit(self,vobj,mode):
FreeCADGui.Control.closeDialog()
return
return False
class ArchSelectionObserver:
def __init__(self,origin,watched):

View File

@ -28,7 +28,7 @@ ADD_CUSTOM_TARGET(Arch ALL
SOURCES ${all_files}
)
fc_copy_sources("Mod/Arch" "Arch" ${all_files})
fc_copy_sources(Arch "${CMAKE_BINARY_DIR}/Mod/Arch" ${all_files})
INSTALL(
FILES ${Arch_SRCS}

View File

@ -23,7 +23,12 @@ SET(Assembly_SRCS
add_library(Assembly SHARED ${Assembly_SRCS})
target_link_libraries(Assembly ${Assembly_LIBS})
fc_copy_script("Mod/Assembly" "Assembly" Init.py)
fc_target_copy_resource(Assembly
${CMAKE_SOURCE_DIR}/src/Mod/Assembly
${CMAKE_BINARY_DIR}/Mod/Assembly
Init.py)
if(MSVC)
set_target_properties(Assembly PROPERTIES SUFFIX ".pyd")

View File

@ -33,7 +33,12 @@ SET(AssemblyGui_SRCS
add_library(AssemblyGui SHARED ${AssemblyGui_SRCS})
target_link_libraries(AssemblyGui ${AssemblyGui_LIBS})
fc_copy_script("Mod/Assembly" "AssemblyGui" InitGui.py)
fc_target_copy_resource(AssemblyGui
${CMAKE_SOURCE_DIR}/src/Mod/Assembly
${CMAKE_BINARY_DIR}/Mod/Assembly
InitGui.py)
if(MSVC)
set_target_properties(AssemblyGui PROPERTIES SUFFIX ".pyd")

View File

@ -23,7 +23,12 @@ SET(Complete_SRCS
add_library(Complete SHARED ${Complete_SRCS})
target_link_libraries(Complete ${Complete_LIBS})
fc_copy_script("Mod/Complete" "Complete" Init.py)
fc_target_copy_resource(Complete
${CMAKE_SOURCE_DIR}/src/Mod/Complete
${CMAKE_BINARY_DIR}/Mod/Complete
Init.py)
if(MSVC)
set_target_properties(Complete PROPERTIES SUFFIX ".pyd")

View File

@ -29,7 +29,12 @@ SET(CompleteGui_SRCS
add_library(CompleteGui SHARED ${CompleteGui_SRCS})
target_link_libraries(CompleteGui ${CompleteGui_LIBS})
fc_copy_script("Mod/Complete" "CompleteGui" InitGui.py)
fc_target_copy_resource(CompleteGui
${CMAKE_SOURCE_DIR}/src/Mod/Complete
${CMAKE_BINARY_DIR}/Mod/Complete
InitGui.py)
if(MSVC)
set_target_properties(CompleteGui PROPERTIES SUFFIX ".pyd")

View File

@ -34,7 +34,7 @@ ADD_CUSTOM_TARGET(Draft ALL
SOURCES ${all_files}
)
fc_copy_sources("Mod/Draft" "Draft" ${all_files})
fc_copy_sources(Draft "${CMAKE_BINARY_DIR}/Mod/Draft" ${all_files})
INSTALL(

View File

@ -100,7 +100,8 @@ def getParamType(param):
return "string"
elif param in ["textheight","tolerance","gridSpacing"]:
return "float"
elif param in ["selectBaseObjects","alwaysSnap","grid","fillmode","saveonexit","maxSnap"]:
elif param in ["selectBaseObjects","alwaysSnap","grid","fillmode","saveonexit","maxSnap",
"SvgLinesBlack","dxfStdSize"]:
return "bool"
elif param in ["color","constructioncolor","snapcolor"]:
return "unsigned"
@ -782,7 +783,6 @@ def rotate(objectslist,angle,center=Vector(0,0,0),axis=Vector(0,0,1),copy=False)
if len(newobjlist) == 1: return newobjlist[0]
return newobjlist
def scale(objectslist,delta=Vector(1,1,1),center=Vector(0,0,0),copy=False,legacy=False):
'''scale(objects,vector,[center,copy,legacy]): Scales the objects contained
in objects (that can be a list of objects or an object) of the given scale
@ -1024,13 +1024,6 @@ def draftify(objectslist,makeblock=False):
return newobjlist[0]
return newobjlist
def getrgb(color):
"getRGB(color): returns a rgb value #000000 from a freecad color"
r = str(hex(int(color[0]*255)))[2:].zfill(2)
g = str(hex(int(color[1]*255)))[2:].zfill(2)
b = str(hex(int(color[2]*255)))[2:].zfill(2)
return "#"+r+g+b
def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="shape color",direction=None):
'''getSVG(object,[modifier],[textmodifier],[linestyle],[fillstyle],[direction]):
returns a string containing a SVG representation of the given object. the modifier attribute
@ -1052,6 +1045,18 @@ def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="s
plane = WorkingPlane.plane()
plane.alignToPointAndAxis(Vector(0,0,0),fcvec.neg(direction),0)
def getrgb(color):
"getRGB(color): returns a rgb value #000000 from a freecad color"
r = str(hex(int(color[0]*255)))[2:].zfill(2)
g = str(hex(int(color[1]*255)))[2:].zfill(2)
b = str(hex(int(color[2]*255)))[2:].zfill(2)
col = "#"+r+g+b
if col == "#ffffff":
print getParam('SvgLinesBlack')
if getParam('SvgLinesBlack'):
col = "#000000"
return col
def getProj(vec):
if not plane: return vec
nx = fcvec.project(vec,plane.u)
@ -1077,10 +1082,19 @@ def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="s
v = getProj(e.Vertexes[-1].Point)
svg += 'L '+ str(v.x) +' '+ str(v.y) + ' '
elif isinstance(e.Curve,Part.Circle):
if len(e.Vertexes) == 1:
# complete circle
svg = getCircle(e)
return svg
r = e.Curve.Radius
drawing_plane_normal = FreeCAD.DraftWorkingPlane.axis
if plane: drawing_plane_normal = plane.axis
flag_large_arc = (((e.ParameterRange[1] - e.ParameterRange[0]) / math.pi) % 2) > 1
flag_sweep = e.Curve.Axis * drawing_plane_normal >= 0
v = getProj(e.Vertexes[-1].Point)
svg += 'A '+ str(r) + ' '+ str(r) +' 0 0 1 '+ str(v.x) +' '
svg += str(v.y) + ' '
svg += 'A ' + str(r) + ' ' + str(r) + ' '
svg += '0 ' + str(int(flag_large_arc)) + ' ' + str(int(flag_sweep)) + ' '
svg += str(v.x) + ' ' + str(v.y) + ' '
if fill != 'none': svg += 'Z'
svg += '" '
svg += 'stroke="' + stroke + '" '
@ -1092,6 +1106,21 @@ def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="s
svg += '/>\n'
return svg
def getCircle(edge):
cen = getProj(edge.Curve.Center)
rad = edge.Curve.Radius
svg = '<circle cx="' + str(cen.x)
svg += '" cy="' + str(cen.y)
svg += '" r="' + str(rad)+'" '
svg += 'stroke="' + stroke + '" '
svg += 'stroke-width="' + str(width) + ' px" '
svg += 'style="stroke-width:'+ str(width)
svg += ';stroke-miterlimit:4'
svg += ';stroke-dasharray:' + lstyle
svg += ';fill:' + fill + '"'
svg += '/>\n'
return svg
if getType(obj) == "Dimension":
p1,p2,p3,p4,tbase,norm,rot = obj.ViewObject.Proxy.calcGeom(obj)
dimText = getParam("dimPrecision")
@ -1225,18 +1254,7 @@ def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="s
if (fcgeo.findEdge(e,wiredEdges) == None):
svg += getPath([e])
else:
cen = getProj(obj.Shape.Edges[0].Curve.Center)
rad = obj.Shape.Edges[0].Curve.Radius
svg = '<circle cx="' + str(cen.x)
svg += '" cy="' + str(cen.y)
svg += '" r="' + str(rad)+'" '
svg += 'stroke="' + stroke + '" '
svg += 'stroke-width="' + str(width) + ' px" '
svg += 'style="stroke-width:'+ str(width)
svg += ';stroke-miterlimit:4'
svg += ';stroke-dasharray:' + lstyle
svg += ';fill:' + fill + '"'
svg += '/>\n'
svg = getCircle(obj.Shape.Edges[0])
return svg
def makeDrawingView(obj,page,lwmod=None,tmod=None):
@ -1372,7 +1390,7 @@ def makeSketch(objectslist,autoconstraints=False,addTo=None,name="Sketch"):
FreeCAD.ActiveDocument.recompute()
return nobj
def makePoint(X=0, Y=0, Z=0,color=(0,1,0),name = "Point", point_size= 5):
def makePoint(X=0, Y=0, Z=0,color=None,name = "Point", point_size= 5):
''' make a point (at coordinates x,y,z ,color(r,g,b),point_size)
example usage:
p1 = makePoint()
@ -1383,6 +1401,8 @@ def makePoint(X=0, Y=0, Z=0,color=(0,1,0),name = "Point", point_size= 5):
p1.X = 1 #move it in x
p1.ViewObject.PointColor =(0.0,0.0,1.0) #change the color-make sure values are floats
'''
if not color:
color = FreeCADGui.draftToolBar.getDefaultColor('ui')
obj=FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
_Point(obj,X,Y,Z)
_ViewProviderPoint(obj.ViewObject)
@ -1470,7 +1490,10 @@ class _ViewProviderDraft:
def __init__(self, obj):
obj.Proxy = self
obj.addProperty("App::PropertyEnumeration","DrawStyle","Base",
"The line style of this object")
self.Object = obj.Object
obj.DrawStyle = ["solid","dashed","dotted","dashdot"]
def attach(self, obj):
self.Object = obj.Object
@ -1487,8 +1510,21 @@ class _ViewProviderDraft:
return mode
def onChanged(self, vp, prop):
if prop == "DrawStyle":
self.setStyle(vp)
return
def setStyle(self,vobj):
ds = vobj.RootNode.getChild(2).getChild(0).getChild(0).getChild(1)
if vobj.DrawStyle == "solid":
ds.linePattern = 0xffff
elif vobj.DrawStyle == "dotted":
ds.linePattern = 0x0f0f
elif vobj.DrawStyle == "dashed":
ds.linePattern = 0xf00f
elif vobj.DrawStyle == "dashdot":
ds.linePattern = 0xff88
def __getstate__(self):
return None
@ -2080,6 +2116,8 @@ class _ViewProviderRectangle(_ViewProviderDraft):
if self.texture:
r.removeChild(self.texture)
self.texture = None
elif prop == "DrawStyle":
self.setStyle(vp)
return
class _Circle:
@ -2246,6 +2284,8 @@ class _ViewProviderWire(_ViewProviderDraft):
rn.addChild(self.pt)
else:
rn.removeChild(self.pt)
elif prop == "DrawStyle":
self.setStyle(vp)
return
def claimChildren(self):
@ -2406,6 +2446,8 @@ class _ViewProviderBSpline(_ViewProviderDraft):
rn.addChild(self.pt)
else:
rn.removeChild(self.pt)
elif prop == "DrawStyle":
self.setStyle(vp)
return
class _Block:

View File

@ -147,12 +147,10 @@ class DraftTaskPanel:
def getStandardButtons(self):
return int(QtGui.QDialogButtonBox.Cancel)
def accept(self):
if FreeCAD.activeDraftCommand:
FreeCAD.activeDraftCommand.finish()
FreeCADGui.ActiveDocument.resetEdit()
return True
def reject(self):
if FreeCAD.activeDraftCommand:
FreeCAD.activeDraftCommand.finish()
FreeCADGui.ActiveDocument.resetEdit()
return True
class DraftToolBar:

File diff suppressed because it is too large Load Diff

View File

@ -280,6 +280,26 @@ If color mapping is choosed, you must choose a color mapping file containing a t
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_8">
<property name="toolTip">
<string>If this is checked, imported texts will get the standard Draft text size, instead of the size they have in the DXF document</string>
</property>
<property name="text">
<string>Use standard font size for texts</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>dxfStdSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Draft</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -393,6 +413,29 @@ If color mapping is choosed, you must choose a color mapping file containing a t
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_6">
<property name="toolTip">
<string>When exporting SVG views, make all white linework appear in black, for better readability against white backgrounds</string>
</property>
<property name="text">
<string>Translate white line color to black</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SvgLinesBlack</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Draft</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>

View File

@ -161,9 +161,10 @@ def isColinear(vlist):
'''isColinear(list_of_vectors): checks if vectors in given list are colinear'''
typecheck ([(vlist,list)], "isColinear");
if len(vlist) < 3: return True
p = precision()
first = vlist[1].sub(vlist[0])
for i in range(2,len(vlist)):
if angle(vlist[i].sub(vlist[0]),first) != 0:
if round(angle(vlist[i].sub(vlist[0]),first),p) != 0:
return False
return True

View File

@ -70,6 +70,29 @@ def decodeName(name):
decodedName = name
return decodedName
def deformat(text):
print text
"removes weird formats in texts and wipes UTF characters"
# remove ACAD string formatation
#t = re.sub('{([^!}]([^}]|\n)*)}', '', text)
t = text.strip("{}")
t = re.sub("\\\.*?;","",t)
# replace non-UTF chars
t = re.sub("ã","a",t)
t = re.sub("ç","c",t)
t = re.sub("õ","o",t)
t = re.sub("à","a",t)
t = re.sub("á","a",t)
t = re.sub("â","a",t)
t = re.sub("é","e",t)
t = re.sub("è","e",t)
t = re.sub("ê","e",t)
t = re.sub("í","i",t)
# replace degrees, diameters chars
t = re.sub('%%d','°',t)
t = re.sub('%%c','Ø',t)
return t
def locateLayer(wantedLayer):
"returns layer group and creates it if needed"
wantedLayerName = decodeName(wantedLayer)
@ -81,6 +104,17 @@ def locateLayer(wantedLayer):
layers.append(newLayer)
return newLayer
def getdimheight(style):
"returns the dimension text height from the given dimstyle"
for t in drawing.tables.data:
if t.name == 'dimstyle':
for a in t.data:
if hasattr(a,"type"):
if a.type == "dimstyle":
if rawValue(a,2) == style:
return rawValue(a,140)
return None
def calcBulge(v1,bulge,v2):
'''
calculates intermediary vertex for curved segments.
@ -137,6 +171,7 @@ class fcformat:
self.paramstyle = params.GetInt("dxfstyle")
self.join = params.GetBool("joingeometry")
self.makeBlocks = params.GetBool("groupLayers")
self.stdSize = params.GetBool("dxfStdSize")
bparams = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")
if self.paramstyle > 1:
@ -223,16 +258,19 @@ class fcformat:
print table
return table
def formatObject(self,obj,dxfobj,textmode=False):
def formatObject(self,obj,dxfobj=None):
"applies color and linetype to objects"
if self.paramstyle == 1:
if textmode:
if self.paramstyle == 0:
if hasattr(obj.ViewObject,"TextColor"):
obj.ViewObject.TextColor = (0.0,0.0,0.0)
elif self.paramstyle == 1:
if hasattr(obj.ViewObject,"TextColor"):
obj.ViewObject.TextColor = self.col
else:
obj.ViewObject.LineColor = self.col
obj.ViewObject.LineWidth = self.lw
elif self.paramstyle == 2:
if textmode:
elif (self.paramstyle == 2) and dxfobj:
if hasattr(obj.ViewObject,"TextColor"):
if dxfobj.color_index == 256: cm = self.getGroupColor(dxfobj)[:3]
else: cm = dxfColorMap.color_map[dxfobj.color_index]
obj.ViewObject.TextColor = (cm[0],cm[1],cm[2])
@ -242,8 +280,8 @@ class fcformat:
else: cm = dxfColorMap.color_map[dxfobj.color_index]
obj.ViewObject.LineColor = (cm[0],cm[1],cm[2],0.0)
obj.ViewObject.LineWidth = self.lw
elif self.paramstyle == 3:
if textmode:
elif (self.paramstyle == 3) and dxfobj:
if hasattr(obj.ViewObject,"TextColor"):
cm = table[dxfobj.color_index][0]
wm = table[dxfobj.color_index][1]
obj.ViewObject.TextColor = (cm[0],cm[1],cm[2])
@ -290,7 +328,7 @@ def drawLine(line,shapemode=False):
warn(line)
return None
def drawPolyline(polyline,shapemode=False):
def drawPolyline(polyline,shapemode=False,num=None):
"returns a Part shape from a dxf polyline"
if (len(polyline.points) > 1):
edges = []
@ -308,13 +346,13 @@ def drawPolyline(polyline,shapemode=False):
cv = calcBulge(v1,polyline.points[p].bulge,v2)
if fcvec.isColinear([v1,cv,v2]):
try: edges.append(Part.Line(v1,v2).toShape())
except: warn(polyline)
except: warn(polyline,num)
else:
try: edges.append(Part.Arc(v1,cv,v2).toShape())
except: warn(polyline)
except: warn(polyline,num)
else:
try: edges.append(Part.Line(v1,v2).toShape())
except: warn(polyline)
except: warn(polyline,num)
verts.append(v2)
if polyline.closed:
p1 = polyline.points[len(polyline.points)-1]
@ -324,11 +362,15 @@ def drawPolyline(polyline,shapemode=False):
cv = calcBulge(v1,polyline.points[-1].bulge,v2)
if not fcvec.equals(v1,v2):
if fcvec.isColinear([v1,cv,v2]):
try: edges.append(Part.Line(v1,v2).toShape())
except: warn(polyline)
try:
edges.append(Part.Line(v1,v2).toShape())
except:
warn(polyline,num)
else:
try: edges.append(Part.Arc(v1,cv,v2).toShape())
except: warn(polyline)
try:
edges.append(Part.Arc(v1,cv,v2).toShape())
except:
warn(polyline,num)
if edges:
try:
if (fmt.paramstyle >= 4) and (not curves) and (not shapemode):
@ -342,7 +384,7 @@ def drawPolyline(polyline,shapemode=False):
else:
return Part.Wire(edges)
except:
warn(polyline)
warn(polyline,num)
return None
def drawArc(arc,shapemode=False):
@ -495,7 +537,7 @@ def drawSpline(spline,shapemode=False):
return ob
else:
sp = Part.BSplineCurve()
print knots
# print knots
sp.interpolate(verts)
sh = Part.Wire(sp.toShape())
if closed:
@ -506,8 +548,11 @@ def drawSpline(spline,shapemode=False):
warn(spline)
return None
def drawBlock(blockref):
def drawBlock(blockref,num=None):
"returns a shape from a dxf block reference"
if not fmt.paramstarblocks:
if blockref.name[0] == '*':
return None
shapes = []
for line in blockref.entities.get_type('line'):
s = drawLine(line,shapemode=True)
@ -525,8 +570,10 @@ def drawBlock(blockref):
s = drawCircle(circle,shapemode=True)
if s: shapes.append(s)
for insert in blockref.entities.get_type('insert'):
s = drawInsert(insert)
if s: shapes.append(s)
print "insert ",insert," in block ",insert.block[0]
if fmt.paramstarblocks or insert.block[0] != '*':
s = drawInsert(insert)
if s: shapes.append(s)
for solid in blockref.entities.get_type('solid'):
s = drawSolid(solid)
if s: shapes.append(s)
@ -534,11 +581,14 @@ def drawBlock(blockref):
s = drawSpline(spline,shapemode=True)
if s: shapes.append(s)
for text in blockref.entities.get_type('text'):
if fmt.dxflayout or (not rawValue(text,67)):
addText(text)
if fmt.paramtext:
if fmt.dxflayout or (not rawValue(text,67)):
addText(text)
for text in blockref.entities.get_type('mtext'):
if fmt.dxflayout or (not rawValue(text,67)):
addText(text)
if fmt.paramtext:
if fmt.dxflayout or (not rawValue(text,67)):
print "adding block text",text.value, " from ",blockref
addText(text)
try: shape = Part.makeCompound(shapes)
except: warn(blockref)
if shape:
@ -546,14 +596,14 @@ def drawBlock(blockref):
return shape
return None
def drawInsert(insert):
def drawInsert(insert,num=None):
if blockshapes.has_key(insert):
shape = blockshapes[insert.block]
else:
shape = None
for b in drawing.blocks.data:
if b.name == insert.block:
shape = drawBlock(b)
shape = drawBlock(b,num)
if fmt.paramtext:
attrs = attribs(insert)
for a in attrs:
@ -598,7 +648,6 @@ def attribs(insert):
j = index+1
while True:
ent = drawing.entities.data[j]
print str(ent)
if str(ent) == 'seqend':
return atts
elif str(ent) == 'attrib':
@ -615,6 +664,7 @@ def addObject(shape,name="Shape",layer=None):
if layer:
lay=locateLayer(layer)
lay.addObject(newob)
fmt.formatObject(newob)
return newob
def addText(text,attrib=False):
@ -630,18 +680,27 @@ def addText(text,attrib=False):
pos = FreeCAD.Vector(text.loc[0],text.loc[1],text.loc[2])
hgt = text.height
if val:
newob=doc.addObject("App::Annotation","Text")
if attrib:
newob = doc.addObject("App::Annotation","Attribute")
else:
newob = doc.addObject("App::Annotation","Text")
lay.addObject(newob)
val = re.sub('{([^!}]([^}]|\n)*)}', '', val)
val = re.sub('%%d','°',val)
val = re.sub('%%c','Ø',val)
val = val.decode("Latin1").encode("Latin1")
val = deformat(val)
#val = val.decode("Latin1").encode("Latin1")
newob.LabelText = val
newob.Position = pos
if gui:
newob.ViewObject.FontSize=float(hgt)
if fmt.stdSize:
newob.ViewObject.FontSize = FreeCADGui.draftToolBar.fontsize
else:
newob.ViewObject.FontSize = float(hgt)
if hasattr(text,"alignment"):
if text.alignment in [2,5,8]:
newob.ViewObject.Justification = "Center"
elif text.alignment in [3,6,9]:
newob.ViewObject.Justification = "Right"
newob.ViewObject.DisplayMode = "World"
fmt.formatObject(newob,text,textmode=True)
fmt.formatObject(newob,text)
def addToBlock(obj,layer):
"adds given shape to the layer dict"
@ -715,10 +774,12 @@ def processdxf(document,filename):
polylines.append(p)
else:
polylines.append(p)
if polylines: FreeCAD.Console.PrintMessage("drawing "+str(len(polylines))+" polylines...\n")
if polylines:
FreeCAD.Console.PrintMessage("drawing "+str(len(polylines))+" polylines...\n")
num = 0
for polyline in polylines:
if fmt.dxflayout or (not rawValue(polyline,67)):
shape = drawPolyline(polyline)
shape = drawPolyline(polyline,num)
if shape:
if fmt.paramstyle == 5:
if isinstance(shape,Part.Shape):
@ -743,6 +804,7 @@ def processdxf(document,filename):
else:
newob = addObject(shape,"Polyline",polyline.layer)
if gui: fmt.formatObject(newob,polyline)
num += 1
# drawing arcs
@ -841,7 +903,8 @@ def processdxf(document,filename):
if fmt.paramtext:
texts = drawing.entities.get_type("mtext")
texts.extend(drawing.entities.get_type("text"))
if texts: FreeCAD.Console.PrintMessage("drawing "+str(len(texts))+" texts...\n")
if texts:
FreeCAD.Console.PrintMessage("drawing "+str(len(texts))+" texts...\n")
for text in texts:
if fmt.dxflayout or (not rawValue(text,67)):
addText(text)
@ -914,11 +977,63 @@ def processdxf(document,filename):
dim.layer = layer
dim.color_index = 256
fmt.formatObject (newob,dim)
if fmt.stdSize:
newob.ViewObject.FontSize = FreeCADGui.draftToolBar.fontsize
else:
st = rawValue(dim,3)
newob.ViewObject.FontSize = float(getdimheight(st))
else: FreeCAD.Console.PrintMessage("skipping dimensions...\n")
# drawing blocks
# drawing points
points = drawing.entities.get_type("point")
if points: FreeCAD.Console.PrintMessage("drawing "+str(len(points))+" points...\n")
for point in points:
x = rawValue(point,10)
y = rawValue(point,20)
z = rawValue(point,30)
lay = rawValue(point,8)
if fmt.dxflayout or (not rawValue(point,67)):
if fmt.makeBlocks:
shape = Part.Vertex(x,y,z)
addToBlock(shape,lay)
else:
newob = Draft.makePoint(x,y,z)
lay = locateLayer(lay)
lay.addObject(newob)
if gui:
fmt.formatObject(newob,point)
# drawing leaders
if fmt.paramtext:
leaders = drawing.entities.get_type("leader")
if leaders:
FreeCAD.Console.PrintMessage("drawing "+str(len(leaders))+" leaders...\n")
for leader in leaders:
if fmt.dxflayout or (not rawValue(leader,67)):
pts = []
for d in leader.data:
if d[0] == 10:
pts.append([d[1]])
elif d[0] in [20,30]:
pts[-1].append(d[1])
pts.reverse()
points = []
for p in pts:
points.append(Vector(p[0],p[1],p[2]))
newob = Draft.makeWire(points)
lay = locateLayer(rawValue(leader,8))
lay.addObject(newob)
if gui:
newob.ViewObject.EndArrow = True
fmt.formatObject(newob,leader)
else:
FreeCAD.Console.PrintMessage("skipping leaders...\n")
# drawing blocks
inserts = drawing.entities.get_type("insert")
if not fmt.paramstarblocks:
FreeCAD.Console.PrintMessage("skipping *blocks...\n")
@ -933,18 +1048,21 @@ def processdxf(document,filename):
blockrefs = drawing.blocks.data
for ref in blockrefs:
drawBlock(ref)
num = 0
for insert in inserts:
shape = drawInsert(insert)
shape = drawInsert(insert,num)
if shape:
if fmt.makeBlocks:
addToBlock(shape,block.layer)
addToBlock(shape,insert.layer)
else:
newob = addObject(shape,"Block."+insert.block,insert.layer)
if gui: fmt.formatObject(newob,insert)
num += 1
# make blocks, if any
if fmt.makeBlocks:
print "creating layerblocks..."
for k,l in layerBlocks.iteritems():
shape = drawLayerBlock(l)
if shape:
@ -953,6 +1071,8 @@ def processdxf(document,filename):
# finishing
print "done processing"
doc.recompute()
FreeCAD.Console.PrintMessage("successfully imported "+filename+"\n")
if badobjects: print "dxf: ",len(badobjects)," objects were not imported"
@ -960,9 +1080,9 @@ def processdxf(document,filename):
del doc
del blockshapes
def warn(dxfobject):
def warn(dxfobject,num=None):
"outputs a warning if a dxf object couldn't be imported"
print "dxf: couldn't import ", dxfobject
print "dxf: couldn't import ", dxfobject, " (",num,")"
badobjects.append(dxfobject)
def open(filename):

View File

@ -216,19 +216,10 @@ def getcolor(color):
b = float(v[2]/255.0)
return (r,g,b,0.0)
def getsize(width):
"extracts a number from the given string (removes suffixes)"
if width[-1] == "%":
return float(width[:-1])
elif len(width) > 1:
for s in ['pt','pc','mm','cm','in','px']:
if width[-2:] == s:
return float(width[:-2])
try:
s = float(width)
return s
except ValueError:
return width
def getsize(length):
"""extracts a number from the given string (removes unit suffixes)"""
number, exponent, unit=re.findall('([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)(px|pt|pc|mm|cm|in|em|ex|%)?',length)[0]
return float(number)
def makewire(path,checkclosed=False,donttry=False):
'''try to make a wire out of the list of edges. If the 'Wire' functions fails or the wire is not

View File

@ -69,9 +69,21 @@ ENDIF(MSVC)
add_library(Drawing SHARED ${Drawing_SRCS} ${Features_SRCS} ${DrawingAlgos_SRCS})
target_link_libraries(Drawing ${Drawing_LIBS})
fc_copy_script("Mod/Drawing" "Drawing" Init.py)
fc_copy_script("Mod/Drawing" "Drawing" DrawingAlgos.py)
fc_copy_script("Mod/Drawing" "Drawing" ${Drawing_Templates})
SET(Drawing_Scripts
Init.py
DrawingAlgos.py
)
fc_target_copy_resource(Drawing
${CMAKE_SOURCE_DIR}/src/Mod/Drawing
${CMAKE_BINARY_DIR}/Mod/Drawing
${Drawing_Scripts})
fc_target_copy_resource(Drawing
${CMAKE_SOURCE_DIR}/src/Mod/Drawing
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Drawing
${Drawing_Templates})
if(MSVC)
set_target_properties(Drawing PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,17 @@ INSTALL(
FILES
Init.py
InitGui.py
DrawingAlgos.py
DrawingExample.py
DrawingTests.py
DESTINATION
Mod/Drawing
)
INSTALL(
DIRECTORY
Templates
DESTINATION
${CMAKE_INSTALL_DATADIR}/Mod/Drawing
FILES_MATCHING PATTERN "*.svg*"
)

View File

@ -88,7 +88,12 @@ endif(MSVC)
add_library(DrawingGui SHARED ${DrawingGui_SRCS} ${DrawingGuiView_SRCS} ${DrawingGuiViewProvider_SRCS})
target_link_libraries(DrawingGui ${DrawingGui_LIBS})
fc_copy_script("Mod/Drawing" "DrawingGui" InitGui.py)
fc_target_copy_resource(DrawingGui
${CMAKE_SOURCE_DIR}/src/Mod/Drawing
${CMAKE_BINARY_DIR}/Mod/Drawing
InitGui.py)
if(MSVC)
set_target_properties(DrawingGui PROPERTIES SUFFIX ".pyd")

File diff suppressed because it is too large Load Diff

View File

@ -86,8 +86,7 @@ public:
protected Q_SLOTS:
void setPrimary(int);
void setRotate(int);
void setSecondary_1(int);
void setSecondary_2(int);
void cb_toggled(bool);
void projectionChanged(int);
void hidden(int);
void smooth(int);
@ -99,25 +98,37 @@ protected:
private:
void pagesize(std::string&);
void autodims();
void compute();
void autodims(float, float, float, float);
void populate_s1();
void populate_s2();
void validate_cbs();
void view_data(int, int, int &, int &);
void updateSecondaries();
private:
class Private;
Ui_TaskOrthoViews * ui;
orthoView * views[3];
int transform[7][7][3]; //matrix containing relative positions and rotations of secondary views depending upon primary view
orthoView * views[4];
QCheckBox * c_boxes[5][5]; //matrix of pointers to gui checkboxes
QLineEdit * inputs[5]; //pointers to manual position/scale boxes
float * data[5]; //pointers to scale, x_pos, y_pos, horiz, vert
int map1[4][3][2]; //contains view directions and rotations for vertical secondary positions, for primaries 1,2,3,4
int map2[4][3][2]; //contains view directions and rotations for H and V secondary positions, primaries 5,6
int view_status[4][4]; //matrix containing status of four orthoView objects (in use, axo, rel x, rel y)
int view_count; //number of active views
int primary; //view direction of primary view
int secondary_1, secondary_2; //view direction of secondary views
int spacing_1, spacing_2; //spacings of secondary view centre from primary view centre
float x_pos, y_pos; //x and y coords for primary view
int rotate; //rotate primary view clockwise by rotate*90
int proj; //first (=-1) or third (=1) angle projection
float scale; //scale of drawing
bool autoscale; //whether or not to run autodims
int pagewidth, pageh1, pageh2; //these are actually the available width and height, calculated in constructor.
float horiz, vert; //centre-centre distances
float pagewidth, pageheight; //these are actually the available width and height, calculated in constructor.
float pageh1, pageh2; //h1 - total usable page height, h2 - total height allowing for info box.
int margin;
int min_space; //minimum space between views, and page edge
};

View File

@ -6,21 +6,30 @@
<rect>
<x>0</x>
<y>0</y>
<width>272</width>
<height>394</height>
<width>250</width>
<height>491</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Orthographic Projection</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>4</number>
</property>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_7">
@ -48,7 +57,523 @@
</item>
</layout>
</item>
<item>
<item row="3" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QCheckBox" name="cb12">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="cb13">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="cb23">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QCheckBox" name="cb33">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="cb11">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QCheckBox" name="cb31">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="cb21">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QCheckBox" name="cb32">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="cb24">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="cb20">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QCheckBox" name="cb42">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="cb22">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Primary view</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Secondary Views</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cb02">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="1">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>230</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>General</string>
</attribute>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>7</y>
<width>231</width>
<height>191</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="auto_tog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Auto scale / position</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Scale</string>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Primary x / y</string>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Secondary dx / dy</string>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QLineEdit" name="scale_0">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0">
<item>
<widget class="QLineEdit" name="x_1">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="y_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="spacing_h_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="spacing_v_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hidden">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Show hidden</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="smooth">
<property name="text">
<string>Show smooth</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Axonometric</string>
</attribute>
</widget>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
@ -93,12 +618,12 @@
</item>
<item>
<property name="text">
<string>Back</string>
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
<string>Back</string>
</property>
</item>
<item>
@ -146,232 +671,6 @@
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Secondary views</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QComboBox" name="secondary_1">
<item>
<property name="text">
<string/>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="secondary_2">
<item>
<property name="text">
<string/>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QCheckBox" name="auto_tog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Auto scale / position</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Scale</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Primary x / y</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Secondary spacings</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QLineEdit" name="scale">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="1,1">
<item>
<widget class="QLineEdit" name="x">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="y">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="spacing1">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="spacing2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hidden">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Show hidden</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="smooth">
<property name="text">
<string>Show smooth</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -9,8 +9,9 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:freecad="http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Svg_Namespace"
width="420"
height="297"
width="420mm"
height="297mm"
viewBox="0 0 420 297"
version="1.1"
id="svg2"
sodipodi:version="0.32"
@ -576,9 +577,6 @@
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:zoom="1.7101889"
inkscape:cx="254.10366"
inkscape:cy="146.94782"
inkscape:window-x="0"
inkscape:window-y="20"
inkscape:current-layer="svg2"

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -8,8 +8,9 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="297"
height="210"
width="297mm"
height="210mm"
viewBox="0 0 297 210"
version="1.1"
id="svg2"
sodipodi:version="0.32"
@ -903,9 +904,6 @@
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:zoom="3.5"
inkscape:cx="119.25908"
inkscape:cy="0.84879944"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:current-layer="svg2"

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -7,7 +7,8 @@
version="1.1"
baseProfile="full"
width="297mm"
height="420mm">
height="420mm"
viewBox="0 0 297 420">
<!-- DrawingContent -->

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 432 B

View File

@ -64,7 +64,12 @@ SOURCE_GROUP("Module" FILES ${Mod_SRCS})
add_library(Fem SHARED ${Fem_SRCS})
target_link_libraries(Fem ${Fem_LIBS})
fc_copy_script("Mod/Fem" "Fem" Init.py convert2TetGen.py)
fc_target_copy_resource(Fem
${CMAKE_SOURCE_DIR}/src/Mod/Fem
${CMAKE_BINARY_DIR}/Mod/Fem
Init.py convert2TetGen.py)
if(MSVC)
set_target_properties(Fem PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,8 @@ INSTALL(
FILES
Init.py
InitGui.py
convert2TetGen.py
FemExample.py
DESTINATION
Mod/Fem
)

View File

@ -51,7 +51,12 @@ SET(FemGui_SRCS
add_library(FemGui SHARED ${FemGui_SRCS})
target_link_libraries(FemGui ${FemGui_LIBS})
fc_copy_script("Mod/Fem" "FemGui" InitGui.py)
fc_target_copy_resource(FemGui
${CMAKE_SOURCE_DIR}/src/Mod/Fem
${CMAKE_BINARY_DIR}/Mod/Fem
InitGui.py)
if(MSVC)
set_target_properties(FemGui PROPERTIES SUFFIX ".pyd")

View File

@ -49,7 +49,7 @@ ADD_CUSTOM_TARGET(Idf ALL
SOURCES ${all_files}
)
fc_copy_sources("Mod/Idf" "Idf" ${all_files})
fc_copy_sources(Idf "${CMAKE_BINARY_DIR}/Mod/Idf" ${all_files})
INSTALL(
FILES

View File

@ -29,7 +29,12 @@ set(Image_SRCS
add_library(Image SHARED ${Image_SRCS})
target_link_libraries(Image ${Image_LIBS})
fc_copy_script("Mod/Image" "Image" Init.py)
fc_target_copy_resource(Image
${CMAKE_SOURCE_DIR}/src/Mod/Image
${CMAKE_BINARY_DIR}/Mod/Image
Init.py)
if(MSVC)
set_target_properties(Image PROPERTIES SUFFIX ".pyd")

View File

@ -54,7 +54,12 @@ SET(ImageGui_SRCS
add_library(ImageGui SHARED ${ImageGui_SRCS})
target_link_libraries(ImageGui ${ImageGui_LIBS})
fc_copy_script("Mod/Image" "ImageGui" InitGui.py)
fc_target_copy_resource(ImageGui
${CMAKE_SOURCE_DIR}/src/Mod/Image
${CMAKE_BINARY_DIR}/Mod/Image
InitGui.py)
if(MSVC)
set_target_properties(ImageGui PROPERTIES SUFFIX ".pyd")

View File

@ -40,8 +40,12 @@ SET(ImportGui_SRCS
add_library(ImportGui SHARED ${ImportGui_SRCS})
target_link_libraries(ImportGui ${ImportGui_LIBS})
fc_copy_script("Mod/Import" "ImportGui" Init.py)
fc_copy_script("Mod/Import" "ImportGui" InitGui.py)
fc_target_copy_resource(ImportGui
${CMAKE_SOURCE_DIR}/src/Mod/Import
${CMAKE_BINARY_DIR}/Mod/Import
Init.py InitGui.py)
if(MSVC)
set_target_properties(ImportGui PROPERTIES SUFFIX ".pyd")

View File

@ -35,7 +35,12 @@ SET(Inspection_SRCS
add_library(Inspection SHARED ${Inspection_SRCS})
target_link_libraries(Inspection ${Inspection_LIBS})
fc_copy_script("Mod/Inspection" "Inspection" Init.py)
fc_target_copy_resource(Inspection
${CMAKE_SOURCE_DIR}/src/Mod/Inspection
${CMAKE_BINARY_DIR}/Mod/Inspection
Init.py)
if(MSVC)
set_target_properties(Inspection PROPERTIES SUFFIX ".pyd")

View File

@ -52,7 +52,12 @@ SET(InspectionGui_SRCS
add_library(InspectionGui SHARED ${InspectionGui_SRCS})
target_link_libraries(InspectionGui ${InspectionGui_LIBS})
fc_copy_script("Mod/Inspection" "InspectionGui" InitGui.py)
fc_target_copy_resource(InspectionGui
${CMAKE_SOURCE_DIR}/src/Mod/Inspection
${CMAKE_BINARY_DIR}/Mod/Inspection
InitGui.py)
if(MSVC)
set_target_properties(InspectionGui PROPERTIES SUFFIX ".pyd")

View File

@ -15,11 +15,11 @@ SET(MachDist_SRCS
SOURCE_GROUP("" FILES ${MachDist_SRCS})
ADD_CUSTOM_TARGET(MachDistortion ALL
ADD_CUSTOM_TARGET( ALL
SOURCES ${MachDist_SRCS}
)
fc_copy_sources("Mod/Machining_Distortion" ${MachDist_SRCS})
fc_copy_sources(MachDistortion "${CMAKE_BINARY_DIR}/Mod/Machining_Distortion" ${MachDist_SRCS})
INSTALL(

View File

@ -331,8 +331,16 @@ endif(MSVC)
add_library(Mesh SHARED ${Core_SRCS} ${WildMagic4_SRCS} ${Mesh_SRCS})
target_link_libraries(Mesh ${Mesh_LIBS})
fc_copy_script ("Mod/Mesh" "Mesh" Init.py BuildRegularGeoms.py)
fc_copy_sources("Mod/Mesh" "Mesh" MeshTestsApp.py)
fc_target_copy_resource(Mesh
${CMAKE_SOURCE_DIR}/src/Mod/Mesh
${CMAKE_BINARY_DIR}/Mod/Mesh
Init.py BuildRegularGeoms.py)
fc_target_copy_resource(Mesh
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/Mod/Mesh
MeshTestsApp.py)
if(MSVC)
set_target_properties(Mesh PROPERTIES SUFFIX ".pyd")

View File

@ -109,7 +109,12 @@ SET(MeshGui_SRCS
add_library(MeshGui SHARED ${MeshGui_SRCS})
target_link_libraries(MeshGui ${MeshGui_LIBS})
fc_copy_script("Mod/Mesh" "MeshGui" InitGui.py)
fc_target_copy_resource(MeshGui
${CMAKE_SOURCE_DIR}/src/Mod/Mesh
${CMAKE_BINARY_DIR}/Mod/Mesh
InitGui.py)
if(MSVC)
set_target_properties(MeshGui PROPERTIES SUFFIX ".pyd")

View File

@ -51,7 +51,12 @@ SET(MeshPart_SRCS
add_library(MeshPart SHARED ${MeshPart_SRCS})
target_link_libraries(MeshPart ${MeshPart_LIBS})
fc_copy_script("Mod/MeshPart" "MeshPart" Init.py)
fc_target_copy_resource(MeshPart
${CMAKE_SOURCE_DIR}/src/Mod/MeshPart
${CMAKE_BINARY_DIR}/Mod/MeshPart
Init.py)
if(MSVC)
set_target_properties(MeshPart PROPERTIES SUFFIX ".pyd")

View File

@ -54,7 +54,12 @@ SET(MeshPartGui_SRCS
add_library(MeshPartGui SHARED ${MeshPartGui_SRCS})
target_link_libraries(MeshPartGui ${MeshPartGui_LIBS})
fc_copy_script("Mod/MeshPart" "MeshPartGui" InitGui.py)
fc_target_copy_resource(MeshPartGui
${CMAKE_SOURCE_DIR}/src/Mod/MeshPart
${CMAKE_BINARY_DIR}/Mod/MeshPart
InitGui.py)
if(MSVC)
set_target_properties(MeshPartGui PROPERTIES SUFFIX ".pyd")

View File

@ -241,7 +241,12 @@ SET(Part_Scripts
add_library(Part SHARED ${Part_SRCS})
target_link_libraries(Part ${Part_LIBS})
fc_copy_script("Mod/Part" "Part" ${Part_Scripts})
fc_target_copy_resource(Part
${CMAKE_SOURCE_DIR}/src/Mod/Part
${CMAKE_BINARY_DIR}/Mod/Part
${Part_Scripts})
if(MSVC)
set_target_properties(Part PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,9 @@ INSTALL(
FILES
Init.py
InitGui.py
MakeBottle.py
TestPartApp.py
TestPartGui.py
DESTINATION
Mod/Part
)

View File

@ -165,7 +165,12 @@ SET(PartGui_Scripts
add_library(PartGui SHARED ${PartGui_SRCS})
target_link_libraries(PartGui ${PartGui_LIBS})
fc_copy_script("Mod/Part" "PartGui" ${PartGui_Scripts})
fc_target_copy_resource(PartGui
${CMAKE_SOURCE_DIR}/src/Mod/Part
${CMAKE_BINARY_DIR}/Mod/Part
${PartGui_Scripts})
if(MSVC)
set_target_properties(PartGui PROPERTIES SUFFIX ".pyd")

View File

@ -90,7 +90,12 @@ SET(PartDesign_Scripts
add_library(PartDesign SHARED ${PartDesign_SRCS})
target_link_libraries(PartDesign ${PartDesign_LIBS})
fc_copy_script("Mod/PartDesign" "PartDesign" ${PartDesign_Scripts})
fc_target_copy_resource(PartDesign
${CMAKE_SOURCE_DIR}/src/Mod/PartDesign
${CMAKE_BINARY_DIR}/Mod/PartDesign
${PartDesign_Scripts})
if(MSVC)
set_target_properties(PartDesign PROPERTIES SUFFIX ".pyd")
@ -105,7 +110,9 @@ elseif(MINGW)
else(MSVC)
set_target_properties(PartDesign PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/PartDesign)
set_target_properties(PartDesign PROPERTIES PREFIX "")
set_target_properties(PartDesign PROPERTIES INSTALL_RPATH ${INSTALL_RPATH})
set_target_properties(PartDesign PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/Mod/PartDesign)
endif(MSVC)
INSTALL(TARGETS PartDesign DESTINATION lib)
# The PartDesign module must go to where the __init__.py file is
INSTALL(TARGETS PartDesign DESTINATION Mod/PartDesign)

View File

@ -6,8 +6,25 @@ endif(FREECAD_BUILD_GUI)
INSTALL(
FILES
__init__.py
Init.py
InitGui.py
TestPartDesignApp.py
TestPartDesignGui.py
DESTINATION
Mod/PartDesign
)
INSTALL(
FILES
Scripts/__init__.py
Scripts/Gear.py
Scripts/DistanceBolt.py
Scripts/Epitrochoid.py
Scripts/RadialCopy.py
Scripts/Parallelepiped.py
Scripts/Spring.py
DESTINATION
Mod/PartDesign/Scripts
)

View File

@ -121,7 +121,12 @@ SET(PartDesignGui_SRCS
add_library(PartDesignGui SHARED ${PartDesignGui_SRCS})
target_link_libraries(PartDesignGui ${PartDesignGui_LIBS})
fc_copy_script("Mod/PartDesign" "PartDesignGui" ${PartDesignGui_Scripts})
fc_target_copy_resource(PartDesignGui
${CMAKE_SOURCE_DIR}/src/Mod/PartDesign
${CMAKE_BINARY_DIR}/Mod/PartDesign
${PartDesignGui_Scripts})
if(MSVC)
set_target_properties(PartDesignGui PROPERTIES SUFFIX ".pyd")
@ -136,7 +141,9 @@ elseif(MINGW)
else(MSVC)
set_target_properties(PartDesignGui PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/PartDesign)
set_target_properties(PartDesignGui PROPERTIES PREFIX "")
set_target_properties(PartDesignGui PROPERTIES INSTALL_RPATH ${INSTALL_RPATH})
set_target_properties(PartDesignGui PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/Mod/PartDesign)
endif(MSVC)
INSTALL(TARGETS PartDesignGui DESTINATION lib)
# The PartDesign module must go to where the __init__.py file is
INSTALL(TARGETS PartDesignGui DESTINATION Mod/PartDesign)

View File

@ -44,7 +44,11 @@ add_library(Points SHARED ${Points_SRCS})
target_link_libraries(Points ${Points_LIBS})
fc_copy_script("Mod/Points" "Points" Init.py)
fc_target_copy_resource(Points
${CMAKE_SOURCE_DIR}/src/Mod/Points
${CMAKE_BINARY_DIR}/Mod/Points
Init.py)
if(MSVC)
set_target_properties(Points PROPERTIES SUFFIX ".pyd")

View File

@ -54,7 +54,12 @@ SET(PointsGui_SRCS
add_library(PointsGui SHARED ${PointsGui_SRCS})
target_link_libraries(PointsGui ${PointsGui_LIBS})
fc_copy_script("Mod/Points" "PointsGui" InitGui.py)
fc_target_copy_resource(PointsGui
${CMAKE_SOURCE_DIR}/src/Mod/Points
${CMAKE_BINARY_DIR}/Mod/Points
InitGui.py)
if(MSVC)
set_target_properties(PointsGui PROPERTIES SUFFIX ".pyd")

View File

@ -51,15 +51,27 @@ SET(Raytracing_SRCS
RaySegment.h
)
SET(Raytracing_Scripts
Init.py
RaytracingExample.py
)
SET(Raytracing_Templates
Templates/ProjectStd.pov
)
add_library(Raytracing SHARED ${Raytracing_SRCS})
target_link_libraries(Raytracing ${Raytracing_LIBS})
fc_copy_script("Mod/Raytracing" "Raytracing" Init.py)
fc_copy_script("Mod/Raytracing" "Raytracing" RaytracingExample.py)
fc_copy_script("Mod/Raytracing" "Raytracing" ${Raytracing_Templates})
fc_target_copy_resource(Raytracing
${CMAKE_SOURCE_DIR}/src/Mod/Raytracing
${CMAKE_BINARY_DIR}/Mod/Raytracing
${Raytracing_Scripts})
fc_target_copy_resource(Raytracing
${CMAKE_SOURCE_DIR}/src/Mod/Raytracing
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Raytracing
${Raytracing_Templates})
if(MSVC)
set_target_properties(Raytracing PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,16 @@ INSTALL(
FILES
Init.py
InitGui.py
RaytracingExample.py
DESTINATION
Mod/Raytracing
)
INSTALL(
DIRECTORY
Templates
DESTINATION
${CMAKE_INSTALL_DATADIR}/Mod/Raytracing
FILES_MATCHING PATTERN "*.pov*"
)

View File

@ -74,7 +74,12 @@ SET(RaytracingGui_SRCS
add_library(RaytracingGui SHARED ${RaytracingGui_SRCS})
target_link_libraries(RaytracingGui ${RaytracingGui_LIBS})
fc_copy_script("Mod/Raytracing" "RaytracingGui" InitGui.py)
fc_target_copy_resource(RaytracingGui
${CMAKE_SOURCE_DIR}/src/Mod/Raytracing
${CMAKE_BINARY_DIR}/Mod/Raytracing
InitGui.py)
if(MSVC)
set_target_properties(RaytracingGui PROPERTIES SUFFIX ".pyd")

View File

@ -32,7 +32,12 @@ SET(Reen_SRCS
add_library(ReverseEngineering SHARED ${Reen_SRCS})
target_link_libraries(ReverseEngineering ${Reen_LIBS})
fc_copy_script("Mod/ReverseEngineering" "ReverseEngineering" Init.py)
fc_target_copy_resource(ReverseEngineering
${CMAKE_SOURCE_DIR}/src/Mod/ReverseEngineering
${CMAKE_BINARY_DIR}/Mod/ReverseEngineering
Init.py)
if(MSVC)
set_target_properties(ReverseEngineering PROPERTIES SUFFIX ".pyd")

View File

@ -39,7 +39,12 @@ SET(ReenGui_SRCS
add_library(ReverseEngineeringGui SHARED ${ReenGui_SRCS})
target_link_libraries(ReverseEngineeringGui ${ReenGui_LIBS})
fc_copy_script("Mod/ReverseEngineering" "ReverseEngineeringGui" InitGui.py)
fc_target_copy_resource(ReverseEngineeringGui
${CMAKE_SOURCE_DIR}/src/Mod/ReverseEngineering
${CMAKE_BINARY_DIR}/Mod/ReverseEngineering
InitGui.py)
if(MSVC)
set_target_properties(ReverseEngineeringGui PROPERTIES SUFFIX ".pyd")

View File

@ -101,6 +101,13 @@ SOURCE_GROUP("KDL" FILES ${KDL_SRCS} ${KDL_HPPS} ${UTIL_SRCS} ${UTIL_HPPS} )
SOURCE_GROUP("Python" FILES ${Python_SRCS})
SOURCE_GROUP("Module" FILES ${Mod_SRCS})
SET(Robot_Scripts
Init.py
KukaExporter.py
RobotExample.py
RobotExampleTrajectoryOutOfShapes.py
)
SET(Robot_Resources
Lib/Kuka/kr500_1.wrl
Lib/Kuka/kr500_1.csv
@ -114,15 +121,21 @@ SET(Robot_Resources
Lib/Kuka/kr125_3.wrl
Lib/Kuka/kr_125.csv
Lib/Kuka/kr125_2.pdf
KukaExporter.py
RobotExample.py
RobotExampleTrajectoryOutOfShapes.py
)
add_library(Robot SHARED ${Robot_SRCS})
target_link_libraries(Robot ${Robot_LIBS})
fc_copy_script("Mod/Robot" "Robot" Init.py)
fc_copy_script("Mod/Robot" "Robot" ${Robot_Resources})
fc_target_copy_resource(Robot
${CMAKE_SOURCE_DIR}/src/Mod/Robot
${CMAKE_BINARY_DIR}/Mod/Robot
${Robot_Scripts})
fc_target_copy_resource(Robot
${CMAKE_SOURCE_DIR}/src/Mod/Robot
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Robot
${Robot_Resources})
if(MSVC)
set_target_properties(Robot PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,20 @@ INSTALL(
FILES
Init.py
InitGui.py
KukaExporter.py
MovieTool.py
RobotExample.py
RobotExampleTrajectoryOutOfShapes.py
DESTINATION
Mod/Robot
)
INSTALL(
DIRECTORY
Lib
DESTINATION
${CMAKE_INSTALL_DATADIR}/Mod/Robot
PATTERN "Makefile*" EXCLUDE
PATTERN "*.pdf" EXCLUDE
)

View File

@ -146,8 +146,12 @@ SET(RobotGui_SRCS
add_library(RobotGui SHARED ${RobotGui_SRCS})
target_link_libraries(RobotGui ${RobotGui_LIBS})
fc_copy_script("Mod/Robot" "RobotGui" InitGui.py)
fc_copy_script("Mod/Robot" "RobotGui" MovieTool.py)
fc_target_copy_resource(RobotGui
${CMAKE_SOURCE_DIR}/src/Mod/Robot
${CMAKE_BINARY_DIR}/Mod/Robot
InitGui.py MovieTool.py)
if(MSVC)
set_target_properties(RobotGui PROPERTIES SUFFIX ".pyd")

View File

@ -31,7 +31,12 @@ SET(Sandbox_SRCS
add_library(Sandbox SHARED ${Sandbox_SRCS})
target_link_libraries(Sandbox ${Sandbox_LIBS})
fc_copy_script("Mod/Sandbox" "Sandbox" Init.py)
fc_target_copy_resource(Sandbox
${CMAKE_SOURCE_DIR}/src/Mod/Sandbox
${CMAKE_BINARY_DIR}/Mod/Sandbox
Init.py)
if(MSVC)
set_target_properties(Sandbox PROPERTIES SUFFIX ".pyd")

View File

@ -42,7 +42,12 @@ SET(SandboxGui_SRCS
add_library(SandboxGui SHARED ${SandboxGui_SRCS})
target_link_libraries(SandboxGui ${SandboxGui_LIBS})
fc_copy_script("Mod/Sandbox" "SandboxGui" InitGui.py)
fc_target_copy_resource(SandboxGui
${CMAKE_SOURCE_DIR}/src/Mod/Sandbox
${CMAKE_BINARY_DIR}/Mod/Sandbox
InitGui.py)
if(MSVC)
set_target_properties(SandboxGui PROPERTIES SUFFIX ".pyd")

View File

@ -77,7 +77,7 @@ ADD_CUSTOM_TARGET(Ship ALL
SOURCES ${all_files}
)
fc_copy_sources("Mod/Ship" "Ship" ${all_files})
fc_copy_sources(Ship "${CMAKE_BINARY_DIR}/Mod/Ship" ${all_files})
INSTALL(
FILES

View File

@ -106,7 +106,12 @@ SET(Sketcher_Scripts
add_library(Sketcher SHARED ${Sketcher_SRCS})
target_link_libraries(Sketcher ${Sketcher_LIBS})
fc_copy_script("Mod/Sketcher" "Sketcher" ${Sketcher_Scripts})
fc_target_copy_resource(Sketcher
${CMAKE_SOURCE_DIR}/src/Mod/Sketcher
${CMAKE_BINARY_DIR}/Mod/Sketcher
${Sketcher_Scripts})
if(MSVC)
set_target_properties(Sketcher PROPERTIES SUFFIX ".pyd")

View File

@ -8,6 +8,10 @@ INSTALL(
FILES
Init.py
InitGui.py
SketcherExample.py
TestSketcherApp.py
TestSketcherGui.py
DESTINATION
Mod/Sketcher
)

View File

@ -98,7 +98,12 @@ SET(SketcherGui_Scripts
add_library(SketcherGui SHARED ${SketcherGui_SRCS})
target_link_libraries(SketcherGui ${SketcherGui_LIBS})
fc_copy_script("Mod/Sketcher" "SketcherGui" ${SketcherGui_Scripts})
fc_target_copy_resource(SketcherGui
${CMAKE_SOURCE_DIR}/src/Mod/Sketcher
${CMAKE_BINARY_DIR}/Mod/Sketcher
${SketcherGui_Scripts})
if(MSVC)
set_target_properties(SketcherGui PROPERTIES SUFFIX ".pyd")

View File

@ -22,7 +22,12 @@ SET(Start_SRCS
add_library(Start SHARED ${Start_SRCS})
target_link_libraries(Start ${Start_LIBS})
fc_copy_script("Mod/Start" "Start" Init.py)
fc_target_copy_resource(Start
${CMAKE_SOURCE_DIR}/src/Mod/Start
${CMAKE_BINARY_DIR}/Mod/Start
Init.py)
if(MSVC)
set_target_properties(Start PROPERTIES SUFFIX ".pyd")

View File

@ -27,8 +27,13 @@ SET(StartGui_SRCS
Workbench.h
)
SET(StartPage_Resources
SET(StartPage_Scripts
InitGui.py
StartPage/StartPage.py
StartPage/__init__.py
)
SET(StartPage_Resources
StartPage/PartDesign.py
StartPage/ArchDesign.py
StartPage/DefaultWorkbench.py
@ -38,7 +43,6 @@ SET(StartPage_Resources
StartPage/LoadDrawingExample.py
StartPage/LoadRobotExample.py
StartPage/Background.jpg
StartPage/__init__.py
StartPage/FreeCAD.png
StartPage/ArchDesign.png
StartPage/PartDesign.png
@ -54,8 +58,16 @@ SET(StartPage_Resources
add_library(StartGui SHARED ${StartGui_SRCS})
target_link_libraries(StartGui ${StartGui_LIBS})
fc_copy_script("Mod/Start" "StartGui" InitGui.py)
fc_copy_script("Mod/Start" "StartGui" ${StartPage_Resources})
fc_target_copy_resource(StartGui
${CMAKE_SOURCE_DIR}/src/Mod/Start
${CMAKE_BINARY_DIR}/Mod/Start
${StartPage_Scripts})
fc_target_copy_resource(StartGui
${CMAKE_SOURCE_DIR}/src/Mod/Start
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Start
${StartPage_Resources})
if(MSVC)
set_target_properties(StartGui PROPERTIES SUFFIX ".pyd")

View File

@ -26,7 +26,11 @@ SET(StartPage_DATA
web.png
)
INSTALL(FILES ${StartPage_SRCS} ${StartPage_DATA}
INSTALL(FILES ${StartPage_SRCS}
DESTINATION Mod/Start/StartPage
)
INSTALL(FILES ${StartPage_DATA}
DESTINATION ${CMAKE_INSTALL_DATADIR}/Mod/Start/StartPage
)

View File

@ -69,7 +69,7 @@ ADD_CUSTOM_TARGET(Surfaces ALL
SOURCES ${all_files}
)
fc_copy_sources("Mod/Surfaces" "Surfaces" ${all_files})
fc_copy_sources(Surfaces "${CMAKE_BINARY_DIR}/Mod/Surfaces" ${all_files})
INSTALL(
FILES

View File

@ -18,7 +18,7 @@ ADD_CUSTOM_TARGET(Test ALL
SOURCES ${Test_SRCS}
)
fc_copy_sources("Mod/Test" "Test" ${Test_SRCS})
fc_copy_sources(Test "${CMAKE_BINARY_DIR}/Mod/Test" ${Test_SRCS})
INSTALL(
FILES

View File

@ -44,13 +44,16 @@ SET(TestGui_SRCS
PreCompiled.cpp
PreCompiled.h
)
SET(TestGuiPy_SRCS
qtunittest.py
)
add_library(QtUnitGui SHARED ${TestGui_SRCS})
target_link_libraries(QtUnitGui ${TestGui_LIBS})
add_dependencies(QtUnitGui Test)
fc_copy_sources_outpath("Mod/Test" "QtUnitGui" qtunittest.py)
fc_copy_sources(QtUnitGui "${CMAKE_BINARY_DIR}/Mod/Test" qtunittest.py)
if(MSVC)
set_target_properties(QtUnitGui PROPERTIES SUFFIX ".pyd")
@ -69,3 +72,5 @@ else(MSVC)
endif(MSVC)
INSTALL(TARGETS QtUnitGui DESTINATION lib)
INSTALL(FILES ${TestGuiPy_SRCS} DESTINATION Mod/Test)

View File

@ -36,8 +36,12 @@ SOURCE_GROUP("Moc" FILES ${SketcherGui_MOC_SRCS})
add_library(WebGui SHARED ${WebGui_SRCS})
target_link_libraries(WebGui ${WebGui_LIBS})
fc_copy_script("Mod/Web" "WebGui" InitGui.py)
fc_copy_script("Mod/Web" "WebGui" Init.py)
fc_target_copy_resource(WebGui
${CMAKE_SOURCE_DIR}/src/Mod/Web
${CMAKE_BINARY_DIR}/Mod/Web
Init.py InitGui.py)
if(MSVC)
set_target_properties(WebGui PROPERTIES SUFFIX ".pyd")

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