Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad into sanguinariojoe-ship
This commit is contained in:
commit
4026554d4e
|
@ -117,6 +117,7 @@ if(FREECAD_LIBPACK_USE)
|
|||
# checking for a unique file in LibPack location to make sure the right version of the LibPack is there
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE6X boost_program_options-vc80-mt-gd.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE7X boost_program_options-vc90-mt-gd-1_39.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE8X boost_program_options-vc90-mt-gd-1_48.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKCUSTOM boost_program_options-vc90-mt-gd-1_41.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
IF(FREECAD_LIBPACK_CHECKFILE6X)
|
||||
include(cMake/UseLibPack6x.cmake)
|
||||
|
@ -128,6 +129,13 @@ if(FREECAD_LIBPACK_USE)
|
|||
set(FREECAD_LIBPACK6 NOTFOUND CACHE STRING "Displays if the libpack has been found")
|
||||
MARK_AS_ADVANCED(FORCE FREECAD_LIBPACK6)
|
||||
set(FREECAD_LIBPACK7 FOUND CACHE STRING "Displays if the libpack has been found")
|
||||
ELSEIF(FREECAD_LIBPACK_CHECKFILE8X)
|
||||
include(cMake/UseLibPack8x.cmake)
|
||||
set(FREECAD_LIBPACK6 NOTFOUND CACHE STRING "Displays if the libpack has been found")
|
||||
set(FREECAD_LIBPACK7 NOTFOUND CACHE STRING "Displays if the libpack has been found")
|
||||
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-1.3.40/swig.exe)
|
||||
MARK_AS_ADVANCED(FORCE FREECAD_LIBPACK6)
|
||||
set(FREECAD_LIBPACK8 FOUND CACHE STRING "Displays if the libpack has been found")
|
||||
ELSEIF(FREECAD_LIBPACK_CHECKCUSTOM)
|
||||
include(cMake/UseLibPackCustom.cmake)
|
||||
set(FREECAD_LIBPACKX FOUND CACHE STRING "Displays if the libpack has been found")
|
||||
|
|
331
cMake/UseLibPack8x.cmake
Normal file
331
cMake/UseLibPack8x.cmake
Normal file
|
@ -0,0 +1,331 @@
|
|||
# ================================================================================
|
||||
# == Win32 is default behaviour use the LibPack copied in Source tree ============
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# General includes
|
||||
|
||||
link_directories(${FREECAD_LIBPACK_DIR}/lib)
|
||||
include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
|
||||
# OpenGL
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
|
||||
set(PYTHON_LIBRARY python26.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XERCESC_LIBRARIES xerces-c_2.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
|
||||
set(Boost_LIBRARIES
|
||||
optimized boost_filesystem-vc90-mt-1_48.lib
|
||||
optimized boost_system-vc90-mt-1_48.lib
|
||||
optimized boost_graph-vc90-mt-1_48.lib
|
||||
optimized boost_program_options-vc90-mt-1_48.lib
|
||||
optimized boost_regex-vc90-mt-1_48.lib
|
||||
optimized boost_signals-vc90-mt-1_48.lib
|
||||
optimized boost_thread-vc90-mt-1_48.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc90-mt-gd-1_48.lib
|
||||
debug boost_date_time-vc90-mt-gd-1_48.lib
|
||||
debug boost_filesystem-vc90-mt-gd-1_48.lib
|
||||
debug boost_iostreams-vc90-mt-gd-1_48.lib
|
||||
debug boost_math_c99f-vc90-mt-gd-1_48.lib
|
||||
debug boost_math_tr1f-vc90-mt-gd-1_48.lib
|
||||
debug boost_thread-vc90-mt-gd-1_48.lib
|
||||
debug boost_system-vc90-mt-gd-1_48.lib
|
||||
debug boost_graph-vc90-mt-gd-1_48.lib
|
||||
debug boost_program_options-vc90-mt-gd-1_48.lib
|
||||
debug boost_regex-vc90-mt-gd-1_48.lib
|
||||
debug boost_signals-vc90-mt-gd-1_48.lib
|
||||
)
|
||||
set(Boost_FOUND TRUE)
|
||||
|
||||
# Zlib
|
||||
set(ZLIB_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/zlib)
|
||||
set(ZLIB_LIBRARIES zdll.lib)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
|
||||
# SMESH
|
||||
set(SMESH_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/smesh)
|
||||
set(SMESH_LIBRARIES
|
||||
StdMeshers.lib
|
||||
MEFISTO2.lib
|
||||
SMESH.lib
|
||||
DriverUNV.lib
|
||||
SMESHDS.lib
|
||||
DriverSTL.lib
|
||||
DriverDAT.lib
|
||||
Driver.lib
|
||||
SMDS.lib
|
||||
)
|
||||
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_LIBRARY_DEBUG coin3d.lib)
|
||||
set(COIN3D_LIBRARY_RELEASE coin3.lib)
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
|
||||
# QT
|
||||
set(QT_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/Qt
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtCore
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtGui
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtDesigner
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtSvg
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtNetwork
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtSql
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtTest
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtUiTools
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtXml
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtOpenGl
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtWebKit
|
||||
)
|
||||
|
||||
set(QT_QTCORE_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/
|
||||
${FREECAD_LIBPACK_DIR}/include/QT/QtCore
|
||||
)
|
||||
|
||||
set(QT_LIBRARIES
|
||||
optimized QtCore4.lib
|
||||
optimized QtGui4.lib
|
||||
optimized QtDesigner4.lib
|
||||
optimized QtSvg4.lib
|
||||
optimized QtNetwork4.lib
|
||||
optimized QtSql4.lib
|
||||
optimized QtTest4.lib
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
debug QtSvgd4.lib
|
||||
debug QtNetworkd4.lib
|
||||
debug QtSqld4.lib
|
||||
debug QtTestd4.lib
|
||||
debug QtXmld4.lib
|
||||
debug QtOpenGld4.lib
|
||||
debug QtWebKitd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY_DEBUG
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
set(QT_MOC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/moc.exe)
|
||||
set(QT_RCC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/rcc.exe)
|
||||
set(QT_HELPCOMPILER_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/qhelpgenerator.exe)
|
||||
set(QT_COLLECTIOMGENERATOR_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/qcollectiongenerator.exe)
|
||||
|
||||
|
||||
|
||||
MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
|
||||
SET(${_qt4_files})
|
||||
SET(${_qt4_options})
|
||||
#SET(_QT4_DOING_OPTIONS FALSE)
|
||||
FOREACH(_currentArg ${ARGN})
|
||||
# IF ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
# SET(_QT4_DOING_OPTIONS TRUE)
|
||||
# ELSE ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
# IF(_QT4_DOING_OPTIONS)
|
||||
# LIST(APPEND ${_qt4_options} "${_currentArg}")
|
||||
# ELSE(_QT4_DOING_OPTIONS)
|
||||
LIST(APPEND ${_qt4_files} "${_currentArg}")
|
||||
# ENDIF(_QT4_DOING_OPTIONS)
|
||||
# ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
ENDFOREACH(_currentArg)
|
||||
ENDMACRO (QT4_EXTRACT_OPTIONS)
|
||||
|
||||
# macro used to create the names of output files preserving relative dirs
|
||||
MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
|
||||
STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
|
||||
STRING(LENGTH ${infile} _infileLength)
|
||||
SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
IF(_infileLength GREATER _binlength)
|
||||
STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
|
||||
IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
|
||||
ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
|
||||
ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
ELSE(_infileLength GREATER _binlength)
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
|
||||
ENDIF(_infileLength GREATER _binlength)
|
||||
SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
|
||||
STRING(REPLACE ".." "__" _outfile ${_outfile})
|
||||
GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
|
||||
GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
|
||||
FILE(MAKE_DIRECTORY ${outpath})
|
||||
SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
|
||||
ENDMACRO (QT4_MAKE_OUTPUT_FILE )
|
||||
|
||||
MACRO (QT4_WRAP_CPP outfiles )
|
||||
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
||||
SET(ARGN)
|
||||
foreach(it ${moc_files})
|
||||
get_filename_component(it ${it} ABSOLUTE)
|
||||
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_MOC_EXECUTABLE}
|
||||
ARGS ${moc_options} ${it} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${it}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
endforeach(it)
|
||||
ENDMACRO (QT4_WRAP_CPP)
|
||||
|
||||
|
||||
# This is a special version of the built in macro qt4_wrap_cpp
|
||||
# It is required since moc'ed files are now included instead of being added to projects directly
|
||||
# It adds a reverse dependency to solve this
|
||||
# This has the unfortunate side effect that some files are always rebuilt
|
||||
# There is probably a cleaner solution than this
|
||||
|
||||
include(AddFileDependencies)
|
||||
|
||||
macro(fc_wrap_cpp outfiles )
|
||||
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
||||
SET(ARGN)
|
||||
foreach(it ${moc_files})
|
||||
get_filename_component(it ${it} ABSOLUTE)
|
||||
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_MOC_EXECUTABLE}
|
||||
ARGS ${moc_options} ${it} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${it}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
add_file_dependencies(${it} ${outfile})
|
||||
endforeach(it)
|
||||
endmacro(fc_wrap_cpp)
|
||||
|
||||
|
||||
MACRO (QT4_ADD_RESOURCES outfiles )
|
||||
QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
||||
SET(ARGN)
|
||||
FOREACH (it ${rcc_files})
|
||||
GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
|
||||
# parse file for dependencies
|
||||
# all files are absolute paths or relative to the location of the qrc file
|
||||
FILE(READ "${infile}" _RC_FILE_CONTENTS)
|
||||
STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
||||
SET(_RC_DEPENDS)
|
||||
FOREACH(_RC_FILE ${_RC_FILES})
|
||||
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
||||
STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
||||
IF(NOT _ABS_PATH_INDICATOR)
|
||||
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
|
||||
ENDIF(NOT _ABS_PATH_INDICATOR)
|
||||
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
||||
ENDFOREACH(_RC_FILE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
DEPENDS ${_RC_DEPENDS})
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH (it)
|
||||
ENDMACRO (QT4_ADD_RESOURCES)
|
||||
|
||||
MACRO (QT4_WRAP_UI outfiles )
|
||||
QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
|
||||
|
||||
FOREACH (it ${ui_files})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_UIC_EXECUTABLE}
|
||||
ARGS -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile})
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH (it)
|
||||
ENDMACRO (QT4_WRAP_UI)
|
||||
|
||||
|
||||
set(QT4_FOUND TRUE)
|
||||
|
||||
# SoQt
|
||||
set(SOQT_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/soqt)
|
||||
set(SOQT_LIBRARY_RELEASE soqt1.lib)
|
||||
set(SOQT_LIBRARY_DEBUG soqt1d.lib)
|
||||
set(SOQT_FOUND TRUE)
|
||||
|
||||
# OpenCV
|
||||
set(OPENCV_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/opencv)
|
||||
set(OPENCV_LIBRARIES cv.lib cvaux.lib cxcore.lib cxts.lib highgui.lib)
|
||||
set(OPENCV_FOUND TRUE)
|
||||
|
||||
# OCC
|
||||
set(OCC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/OpenCascade)
|
||||
set(OCC_LIBRARIES
|
||||
TKFillet
|
||||
TKMesh
|
||||
TKernel
|
||||
TKG2d
|
||||
TKG3d
|
||||
TKMath
|
||||
TKIGES
|
||||
TKSTL
|
||||
TKShHealing
|
||||
TKXSBase
|
||||
TKBool
|
||||
TKXSBase
|
||||
TKXCAF
|
||||
TKLCAF
|
||||
TKCAF
|
||||
TKSTEP
|
||||
TKIGES
|
||||
TKXDESTEP
|
||||
TKXDEIGES
|
||||
TKBO
|
||||
TKBRep
|
||||
TKTopAlgo
|
||||
TKGeomAlgo
|
||||
TKGeomBase
|
||||
TKOffset
|
||||
TKPrim
|
||||
TKSTEP
|
||||
TKSTEPBase
|
||||
TKSTEPAttr
|
||||
TKHLR
|
||||
)
|
||||
set(OCC_LIBRARY_DIR
|
||||
${FREECAD_LIBPACK_DIR}/lib
|
||||
)
|
||||
set(OCC_FOUND TRUE)
|
||||
|
||||
SET(EIGEN2_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen2)
|
||||
set(EIGEN2_FOUND TRUE)
|
||||
|
||||
SET(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
|
||||
set(EIGEN3_FOUND TRUE)
|
||||
|
||||
|
||||
|
||||
|
|
@ -192,6 +192,11 @@ void StdCmdImport::activated(int iMsg)
|
|||
getActiveGuiDocument()->getDocument()->getName(),
|
||||
it.value().toAscii());
|
||||
}
|
||||
|
||||
std::list<Gui::MDIView*> views = getActiveGuiDocument()->getMDIViewsOfType(Gui::View3DInventor::getClassTypeId());
|
||||
for (std::list<MDIView*>::iterator it = views.begin(); it != views.end(); ++it) {
|
||||
(*it)->viewAll();
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdImport::isActive(void)
|
||||
|
|
|
@ -252,6 +252,12 @@ QStringList SoFCOffscreenRenderer::getWriteImageFiletypeInfo()
|
|||
std::string SoFCOffscreenRenderer::createMIBA() const
|
||||
{
|
||||
std::stringstream com;
|
||||
const std::map<std::string, std::string>& cfg = App::Application::Config();
|
||||
std::map<std::string, std::string>::const_iterator it;
|
||||
it = cfg.find("BuildVersionMajor");
|
||||
std::string major = (it != cfg.end() ? it->second : "");
|
||||
it = cfg.find("BuildVersionMinor");
|
||||
std::string minor = (it != cfg.end() ? it->second : "");
|
||||
|
||||
com << setw(7) << setfill(' ') << fixed;
|
||||
com << "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n" ;
|
||||
|
@ -266,8 +272,8 @@ std::string SoFCOffscreenRenderer::createMIBA() const
|
|||
com << " </View>\n" ;
|
||||
com << " <Source>\n" ;
|
||||
com << " <Creator>Unknown</Creator>\n" ;
|
||||
com << " <CreationDate>2006-07-05T01:11:00</CreationDate>\n" ;
|
||||
com << " <CreatingSystem>FreeCAD 0.5</CreatingSystem>\n" ;
|
||||
com << " <CreationDate>" << QDateTime::currentDateTime().toString().toAscii().constData() << "</CreationDate>\n" ;
|
||||
com << " <CreatingSystem>" << App::GetApplication().getExecutableName() << " " << major << "." << minor << "</CreatingSystem>\n" ;
|
||||
com << " <PartNumber>Unknown</PartNumber>\n";
|
||||
com << " <Revision>1.0</Revision>\n";
|
||||
com << " </Source>\n" ;
|
||||
|
|
|
@ -148,26 +148,7 @@ class Snapper:
|
|||
return None
|
||||
|
||||
# setup trackers if needed
|
||||
v = Draft.get3DView()
|
||||
if v in self.trackers[0]:
|
||||
i = self.trackers[0].index(v)
|
||||
self.grid = self.trackers[1][i]
|
||||
self.tracker = self.trackers[2][i]
|
||||
self.extLine = self.trackers[3][i]
|
||||
self.radiusTracker = self.trackers[4][i]
|
||||
else:
|
||||
if Draft.getParam("grid"):
|
||||
self.grid = DraftTrackers.gridTracker()
|
||||
else:
|
||||
self.grid = None
|
||||
self.tracker = DraftTrackers.snapTracker()
|
||||
self.extLine = DraftTrackers.lineTracker(dotted=True)
|
||||
self.radiusTracker = DraftTrackers.radiusTracker()
|
||||
self.trackers[0].append(v)
|
||||
self.trackers[1].append(self.grid)
|
||||
self.trackers[2].append(self.tracker)
|
||||
self.trackers[3].append(self.extLine)
|
||||
self.trackers[4].append(self.radiusTracker)
|
||||
self.setTrackers()
|
||||
|
||||
# getting current snap Radius
|
||||
self.radius = self.getScreenDist(Draft.getParam("snapRange"),screenpos)
|
||||
|
@ -175,10 +156,6 @@ class Snapper:
|
|||
self.radiusTracker.update(self.radius)
|
||||
self.radiusTracker.off()
|
||||
|
||||
# set the grid
|
||||
if self.grid and (not self.forceGridOff):
|
||||
self.grid.set()
|
||||
|
||||
# activate snap
|
||||
oldActive = False
|
||||
if Draft.getParam("alwaysSnap"):
|
||||
|
@ -362,6 +339,19 @@ class Snapper:
|
|||
self.extLine.on()
|
||||
self.setCursor(tsnap[1])
|
||||
return tsnap[2],eline
|
||||
else:
|
||||
tsnap = self.snapToExtPerpendicular(last)
|
||||
if tsnap:
|
||||
if (tsnap[0].sub(point)).Length < self.radius:
|
||||
if self.tracker:
|
||||
self.tracker.setCoords(tsnap[2])
|
||||
self.tracker.setMarker(self.mk[tsnap[1]])
|
||||
self.tracker.on()
|
||||
if self.extLine:
|
||||
self.extLine.p2(tsnap[2])
|
||||
self.extLine.on()
|
||||
self.setCursor(tsnap[1])
|
||||
return tsnap[2],eline
|
||||
|
||||
for o in [self.lastObj[1],self.lastObj[0]]:
|
||||
if o:
|
||||
|
@ -541,6 +531,14 @@ class Snapper:
|
|||
return None
|
||||
return None
|
||||
|
||||
def snapToExtPerpendicular(self,last):
|
||||
"returns a perpendicular X extension snap location"
|
||||
if self.isEnabled("extension") and self.isEnabled("perpendicular"):
|
||||
if last and self.extLine:
|
||||
tmpEdge = Part.Line(self.extLine.p1(),self.extLine.p2()).toShape()
|
||||
np = self.getPerpendicular(tmpEdge,last)
|
||||
return [np,'perpendicular',np]
|
||||
|
||||
def snapToElines(self,e1,e2):
|
||||
"returns a snap location at the infinite intersection of the given edges"
|
||||
snaps = []
|
||||
|
@ -920,16 +918,31 @@ class Snapper:
|
|||
mw.addToolBar(self.toolbar)
|
||||
self.toolbar.show()
|
||||
if FreeCADGui.ActiveDocument:
|
||||
if not self.forceGridOff:
|
||||
if not self.grid:
|
||||
self.grid = DraftTrackers.gridTracker()
|
||||
self.grid.set()
|
||||
self.setTrackers()
|
||||
|
||||
def setGrid(self):
|
||||
"sets the grid, if visible"
|
||||
if self.grid and (not self.forceGridOff):
|
||||
if self.grid.Visible:
|
||||
self.grid.set()
|
||||
def setTrackers(self):
|
||||
v = Draft.get3DView()
|
||||
if v in self.trackers[0]:
|
||||
i = self.trackers[0].index(v)
|
||||
self.grid = self.trackers[1][i]
|
||||
self.tracker = self.trackers[2][i]
|
||||
self.extLine = self.trackers[3][i]
|
||||
self.radiusTracker = self.trackers[4][i]
|
||||
else:
|
||||
if Draft.getParam("grid"):
|
||||
self.grid = DraftTrackers.gridTracker()
|
||||
else:
|
||||
self.grid = None
|
||||
self.tracker = DraftTrackers.snapTracker()
|
||||
self.extLine = DraftTrackers.lineTracker(dotted=True)
|
||||
self.radiusTracker = DraftTrackers.radiusTracker()
|
||||
self.trackers[0].append(v)
|
||||
self.trackers[1].append(self.grid)
|
||||
self.trackers[2].append(self.tracker)
|
||||
self.trackers[3].append(self.extLine)
|
||||
self.trackers[4].append(self.radiusTracker)
|
||||
if not self.forceGridOff:
|
||||
self.grid.set()
|
||||
|
||||
if not hasattr(FreeCADGui,"Snapper"):
|
||||
FreeCADGui.Snapper = Snapper()
|
||||
|
|
|
@ -212,7 +212,7 @@ Sweep::Sweep()
|
|||
ADD_PROPERTY_TYPE(Spine,(0),"Sweep",App::Prop_None,"Path to sweep along");
|
||||
ADD_PROPERTY_TYPE(Solid,(false),"Sweep",App::Prop_None,"Create solid");
|
||||
ADD_PROPERTY_TYPE(Frenet,(false),"Sweep",App::Prop_None,"Frenet");
|
||||
ADD_PROPERTY_TYPE(Transition,(long(0)),"Sweep",App::Prop_None,"Transition mode");
|
||||
ADD_PROPERTY_TYPE(Transition,(long(1)),"Sweep",App::Prop_None,"Transition mode");
|
||||
Transition.setEnums(TransitionEnums);
|
||||
}
|
||||
|
||||
|
@ -244,16 +244,19 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
|||
if (!(spine && spine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())))
|
||||
return new App::DocumentObjectExecReturn("No spine linked.");
|
||||
const std::vector<std::string>& subedge = Spine.getSubValues();
|
||||
if (subedge.size() != 1)
|
||||
return new App::DocumentObjectExecReturn("Not exactly one sub-shape linked.");
|
||||
|
||||
TopoDS_Shape path;
|
||||
const Part::TopoShape& shape = static_cast<Part::Feature*>(spine)->Shape.getValue();
|
||||
if (!shape._Shape.IsNull()) {
|
||||
if (!subedge[0].empty()) {
|
||||
path = shape.getSubShape(subedge[0].c_str());
|
||||
try {
|
||||
BRepBuilderAPI_MakeWire mkWire;
|
||||
for (std::vector<std::string>::const_iterator it = subedge.begin(); it != subedge.end(); ++it) {
|
||||
TopoDS_Shape subshape = shape.getSubShape(it->c_str());
|
||||
mkWire.Add(TopoDS::Edge(subshape));
|
||||
}
|
||||
path = mkWire.Wire();
|
||||
}
|
||||
else {
|
||||
catch (Standard_Failure) {
|
||||
if (shape._Shape.ShapeType() == TopAbs_EDGE)
|
||||
path = shape._Shape;
|
||||
else if (shape._Shape.ShapeType() == TopAbs_WIRE)
|
||||
|
@ -273,8 +276,12 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
|||
const TopoDS_Shape& shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Linked shape is invalid.");
|
||||
// There is a weird behaviour of BRepOffsetAPI_MakePipeShell when trying to add the wire as is.
|
||||
// If we re-create the wire then everything works fine.
|
||||
// https://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=2673&sid=fbcd2ff4589f0b2f79ed899b0b990648#p20268
|
||||
if (shape.ShapeType() == TopAbs_WIRE) {
|
||||
profiles.Append(shape);
|
||||
BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape));
|
||||
profiles.Append(mkWire.Wire());
|
||||
}
|
||||
else if (shape.ShapeType() == TopAbs_EDGE) {
|
||||
BRepBuilderAPI_MakeWire mkWire(TopoDS::Edge(shape));
|
||||
|
|
|
@ -442,7 +442,6 @@ CmdPartImport::CmdPartImport()
|
|||
sPixmap = "Part_Import";
|
||||
}
|
||||
|
||||
|
||||
void CmdPartImport::activated(int iMsg)
|
||||
{
|
||||
QStringList filter;
|
||||
|
@ -471,6 +470,11 @@ void CmdPartImport::activated(int iMsg)
|
|||
doCommand(Doc, "Part.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName());
|
||||
}
|
||||
commitCommand();
|
||||
|
||||
std::list<Gui::MDIView*> views = getActiveGuiDocument()->getMDIViewsOfType(Gui::View3DInventor::getClassTypeId());
|
||||
for (std::list<Gui::MDIView*>::iterator it = views.begin(); it != views.end(); ++it) {
|
||||
(*it)->viewAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -947,6 +951,7 @@ CmdPartLoft::CmdPartLoft()
|
|||
sToolTipText = QT_TR_NOOP("Advanced utility to lofts");
|
||||
sWhatsThis = sToolTipText;
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Part_Loft";
|
||||
}
|
||||
|
||||
void CmdPartLoft::activated(int iMsg)
|
||||
|
@ -972,6 +977,7 @@ CmdPartSweep::CmdPartSweep()
|
|||
sToolTipText = QT_TR_NOOP("Advanced utility to sweep");
|
||||
sWhatsThis = sToolTipText;
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Part_Sweep";
|
||||
}
|
||||
|
||||
void CmdPartSweep::activated(int iMsg)
|
||||
|
|
|
@ -200,12 +200,14 @@ EXTRA_DIST = \
|
|||
Resources/icons/Part_Fillet.svg \
|
||||
Resources/icons/Part_Revolve.svg \
|
||||
Resources/icons/Part_Import.svg \
|
||||
Resources/icons/Part_Loft.svg \
|
||||
Resources/icons/Part_Mirror.svg \
|
||||
Resources/icons/Part_MirrorPNG.png \
|
||||
Resources/icons/Part_RuledSurface.svg \
|
||||
Resources/icons/Part_Shapebuilder.png \
|
||||
Resources/icons/Part_Shapebuilder.svg \
|
||||
Resources/icons/Part_ShapeInfo.svg \
|
||||
Resources/icons/Part_Sweep.svg \
|
||||
Resources/icons/Tree_Part.svg \
|
||||
Resources/icons/preferences-part_design.svg \
|
||||
Resources/icons/PartFeature.svg \
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<file>icons/Part_Fillet.svg</file>
|
||||
<file>icons/Part_Fuse.svg</file>
|
||||
<file>icons/Part_Import.svg</file>
|
||||
<file>icons/Part_Loft.svg</file>
|
||||
<file>icons/Part_Mirror.svg</file>
|
||||
<file>icons/Part_MirrorPNG.png</file>
|
||||
<file>icons/Part_Revolve.svg</file>
|
||||
|
@ -24,6 +25,7 @@
|
|||
<file>icons/Part_Shapebuilder.png</file>
|
||||
<file>icons/Part_ShapeInfo.svg</file>
|
||||
<file>icons/Part_Sphere.svg</file>
|
||||
<file>icons/Part_Sweep.svg</file>
|
||||
<file>icons/Part_Torus.svg</file>
|
||||
<file>icons/preferences-part_design.svg</file>
|
||||
<file>icons/Tree_Part.svg</file>
|
||||
|
|
280
src/Mod/Part/Gui/Resources/icons/Part_Loft.svg
Normal file
280
src/Mod/Part/Gui/Resources/icons/Part_Loft.svg
Normal file
|
@ -0,0 +1,280 @@
|
|||
<?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="64px"
|
||||
height="64px"
|
||||
id="svg3364"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
sodipodi:docname="Part_Loft.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs3366">
|
||||
<linearGradient
|
||||
id="linearGradient3864">
|
||||
<stop
|
||||
id="stop3866"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3868"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient2571"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="342.58258"
|
||||
cy="27.256668"
|
||||
fx="342.58258"
|
||||
fy="27.256668"
|
||||
r="19.571428"
|
||||
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3352"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="345.28433"
|
||||
cy="15.560534"
|
||||
fx="345.28433"
|
||||
fy="15.560534"
|
||||
r="19.571428"
|
||||
gradientTransform="translate(-0.1767767,-2.6516504)" />
|
||||
<linearGradient
|
||||
id="linearGradient3593">
|
||||
<stop
|
||||
style="stop-color:#c8e0f9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3595" />
|
||||
<stop
|
||||
style="stop-color:#637dca;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3597" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3354"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="330.63791"
|
||||
cy="39.962704"
|
||||
fx="330.63791"
|
||||
fy="39.962704"
|
||||
r="19.571428"
|
||||
gradientTransform="translate(-0.1767767,-2.6516504)" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective3372" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient3369"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
|
||||
cx="342.58258"
|
||||
cy="27.256668"
|
||||
fx="342.58258"
|
||||
fy="27.256668"
|
||||
r="19.571428" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3372"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
|
||||
cx="345.28433"
|
||||
cy="15.560534"
|
||||
fx="345.28433"
|
||||
fy="15.560534"
|
||||
r="19.571428" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3375"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
|
||||
cx="330.63791"
|
||||
cy="39.962704"
|
||||
fx="330.63791"
|
||||
fy="39.962704"
|
||||
r="19.571428" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient3380"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
|
||||
cx="320.44025"
|
||||
cy="113.23357"
|
||||
fx="320.44025"
|
||||
fy="113.23357"
|
||||
r="19.571428" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="linearGradient3914"
|
||||
x1="6.94525"
|
||||
y1="36.838673"
|
||||
x2="48.691113"
|
||||
y2="36.838673"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="linearGradient3792"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)"
|
||||
x1="6.8300767"
|
||||
y1="34.146042"
|
||||
x2="48.691113"
|
||||
y2="36.838673" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient3812"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
|
||||
cx="330.63791"
|
||||
cy="39.962704"
|
||||
fx="330.63791"
|
||||
fy="39.962704"
|
||||
r="19.571428" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3814"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
|
||||
cx="345.28433"
|
||||
cy="15.560534"
|
||||
fx="345.28433"
|
||||
fy="15.560534"
|
||||
r="19.571428" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient3816"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
|
||||
cx="320.44025"
|
||||
cy="113.23357"
|
||||
fx="320.44025"
|
||||
fy="113.23357"
|
||||
r="19.571428" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="linearGradient3828"
|
||||
x1="20.383333"
|
||||
y1="32.634235"
|
||||
x2="52.726578"
|
||||
y2="32.634235"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864-1"
|
||||
id="linearGradient3828-2"
|
||||
x1="20.383333"
|
||||
y1="32.634235"
|
||||
x2="52.726578"
|
||||
y2="32.634235"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3864-1">
|
||||
<stop
|
||||
id="stop3866-6"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3868-7"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="translate(-20.410811,9.5711709)"
|
||||
y2="32.634235"
|
||||
x2="52.726578"
|
||||
y1="32.634235"
|
||||
x1="20.383333"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3845"
|
||||
xlink:href="#linearGradient3864-1"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8.671875"
|
||||
inkscape:cx="12.742342"
|
||||
inkscape:cy="32"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="1276"
|
||||
inkscape:window-height="758"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="19"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3369">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<path
|
||||
style="fill:url(#linearGradient3828);fill-opacity:1;stroke:#4b4dba;stroke-width:1.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 21.333333,38.054054 0,13.722523 28.82883,-7.956757 0.461261,-29.405405 z"
|
||||
id="path3820"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:url(#linearGradient3845);fill-opacity:1;stroke:#4b4dba;stroke-width:1.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 12.108108,34.825225 20.526126,38.054054 50.392793,14.068468 23.985586,5.9963967 z"
|
||||
id="path3820-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
id="path3918-3"
|
||||
d="m 12.242668,35.119547 8.794991,3.372715 0.04859,13.032456 C 17.83723,50.533286 15.209236,49.226417 12.558166,47.931269 z"
|
||||
style="fill:none;stroke:#ff0900;stroke-width:2.21737432;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||
<path
|
||||
style="fill:none;stroke:#ff0900;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="m 24.100901,6.227027 26.176576,8.187387 0,29.290091"
|
||||
id="path3864"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.3 KiB |
232
src/Mod/Part/Gui/Resources/icons/Part_Sweep.svg
Normal file
232
src/Mod/Part/Gui/Resources/icons/Part_Sweep.svg
Normal file
|
@ -0,0 +1,232 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
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="64px"
|
||||
height="64px"
|
||||
id="svg3364"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
sodipodi:docname="Part_Sweep_red_thickened_path.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs3366">
|
||||
<linearGradient
|
||||
id="linearGradient4513"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#ff0900;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4515" />
|
||||
</linearGradient>
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lstart"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Lstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path3909"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(1.1) translate(1,0)" />
|
||||
</marker>
|
||||
<linearGradient
|
||||
id="linearGradient3864"
|
||||
osb:paint="gradient">
|
||||
<stop
|
||||
id="stop3866"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:0.44347826;" />
|
||||
<stop
|
||||
id="stop3868"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient2571"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="342.58258"
|
||||
cy="27.256668"
|
||||
fx="342.58258"
|
||||
fy="27.256668"
|
||||
r="19.571428"
|
||||
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3352"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="345.28433"
|
||||
cy="15.560534"
|
||||
fx="345.28433"
|
||||
fy="15.560534"
|
||||
r="19.571428"
|
||||
gradientTransform="translate(-0.1767767,-2.6516504)" />
|
||||
<linearGradient
|
||||
id="linearGradient3593">
|
||||
<stop
|
||||
style="stop-color:#c8e0f9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3595" />
|
||||
<stop
|
||||
style="stop-color:#637dca;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3597" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3593"
|
||||
id="radialGradient3354"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="330.63791"
|
||||
cy="39.962704"
|
||||
fx="330.63791"
|
||||
fy="39.962704"
|
||||
r="19.571428"
|
||||
gradientTransform="translate(-0.1767767,-2.6516504)" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective3372" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient3369"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
|
||||
cx="342.58258"
|
||||
cy="27.256668"
|
||||
fx="342.58258"
|
||||
fy="27.256668"
|
||||
r="19.571428" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="linearGradient3828"
|
||||
x1="20.383333"
|
||||
y1="32.634235"
|
||||
x2="52.726578"
|
||||
y2="32.634235"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.1630793,0,0,1.1396343,-2.5165983,3.4151415)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864-1"
|
||||
id="linearGradient3828-2"
|
||||
x1="20.383333"
|
||||
y1="32.634235"
|
||||
x2="52.726578"
|
||||
y2="32.634235"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3864-1">
|
||||
<stop
|
||||
id="stop3866-6"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3868-7"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(1.1630793,0,0,1.1396343,-26.255988,14.322778)"
|
||||
y2="32.634235"
|
||||
x2="52.726578"
|
||||
y1="32.634235"
|
||||
x1="20.383333"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3845"
|
||||
xlink:href="#linearGradient3864-1"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="9.0078335"
|
||||
inkscape:cx="-3.106479"
|
||||
inkscape:cy="32.608572"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="1102"
|
||||
inkscape:window-height="758"
|
||||
inkscape:window-x="29"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3369">
|
||||
<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">
|
||||
<path
|
||||
style="opacity:0.85;fill:url(#linearGradient3845);fill-opacity:1;stroke:#4b4dba;stroke-width:2.18746471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 11.201557,37.130882 c 0.252178,-0.07113 10.905391,3.84229 14.378208,5.296596 C 45.31682,39.628785 46.26631,22.510259 52.095791,10.58178 L 28.627124,6.652762 c -1.621192,11.174906 -3.334532,23.98441 -17.425567,30.47812 z"
|
||||
id="path3820-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ff0900;stroke-width:2.55285668;stroke-linecap:round;stroke-linejoin:bevel;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 11.414852,53.329345 c -0.162971,-6.91565 0.10332,-4.922865 -0.144914,-16.265896"
|
||||
id="path3918-3"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ff0900;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:30.29999923999999822;stroke-opacity:1;stroke-dasharray:18, 6;stroke-dashoffset:0;marker-start:none"
|
||||
d="M 0.88417837,48.039022 C 11.330775,48.513224 32.686249,53.004323 42.745293,41.872435 51.278061,32.429606 53.4974,19.758654 61.595219,2.2398862"
|
||||
id="path3885"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csc" />
|
||||
<path
|
||||
style="fill:url(#linearGradient3828);fill-opacity:1;fill-rule:nonzero;stroke:#4b4dba;stroke-width:2.18746471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 26.040147,42.43608 0.226329,18.152407 C 44.9786,59.94313 58.160467,44.639618 60.629125,31.212185 L 51.67214,11.437294 C 43.6375,30.278349 43.168055,38.742321 26.040147,42.43608 z"
|
||||
id="path3820"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ff0c00;stroke-width:2.87824273;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 28.798855,6.2907134 23.256841,4.5887046 8.726353,20.099536"
|
||||
id="path3864"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ff0900;stroke-width:2.55299997;stroke-linecap:round;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 11.380951,37.174463 14.558836,5.397865 0.389553,17.96064 C 22.550473,59.403098 14.498258,55.027369 11.414853,53.551374"
|
||||
id="path3918-3-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 8.7 KiB |
|
@ -32,6 +32,7 @@
|
|||
#include "TaskLoft.h"
|
||||
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
|
@ -198,7 +199,8 @@ TaskLoft::TaskLoft()
|
|||
{
|
||||
widget = new LoftWidget();
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
QPixmap(), widget->windowTitle(), true, 0);
|
||||
Gui::BitmapFactory().pixmap("Part_Loft"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "TaskSweep.h"
|
||||
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
|
@ -117,7 +118,7 @@ void SweepWidget::findShapes()
|
|||
|
||||
bool SweepWidget::accept()
|
||||
{
|
||||
Gui::SelectionFilter edgeFilter ("SELECT Part::Feature SUBELEMENT Edge COUNT 1");
|
||||
Gui::SelectionFilter edgeFilter ("SELECT Part::Feature SUBELEMENT Edge COUNT 1..");
|
||||
Gui::SelectionFilter partFilter ("SELECT Part::Feature COUNT 1");
|
||||
bool matchEdge = edgeFilter.match();
|
||||
bool matchPart = partFilter.match();
|
||||
|
@ -127,16 +128,14 @@ bool SweepWidget::accept()
|
|||
}
|
||||
|
||||
// get the selected object
|
||||
std::string objectName, subShape;
|
||||
std::string selection;
|
||||
if (matchEdge) {
|
||||
const std::vector<Gui::SelectionObject>& result = edgeFilter.Result[0];
|
||||
const std::vector<std::string>& edges = result[0].getSubNames();
|
||||
objectName = result.front().getFeatName();
|
||||
subShape = edges.front();
|
||||
selection = result.front().getAsPropertyLinkSubString();
|
||||
}
|
||||
else {
|
||||
const std::vector<Gui::SelectionObject>& result = partFilter.Result[0];
|
||||
objectName = result.front().getFeatName();
|
||||
selection = result.front().getAsPropertyLinkSubString();
|
||||
}
|
||||
|
||||
QString list, solid, frenet;
|
||||
|
@ -166,15 +165,17 @@ bool SweepWidget::accept()
|
|||
try {
|
||||
QString cmd;
|
||||
cmd = QString::fromAscii(
|
||||
"App.getDocument('%6').addObject('Part::Sweep','Sweep')\n"
|
||||
"App.getDocument('%6').ActiveObject.Sections=[%1]\n"
|
||||
"App.getDocument('%6').ActiveObject.Spine=(FreeCAD.ActiveDocument.%2,['%3'])\n"
|
||||
"App.getDocument('%6').ActiveObject.Solid=%4\n"
|
||||
"App.getDocument('%6').ActiveObject.Frenet=%5\n"
|
||||
"App.getDocument('%5').addObject('Part::Sweep','Sweep')\n"
|
||||
"App.getDocument('%5').ActiveObject.Sections=[%1]\n"
|
||||
"App.getDocument('%5').ActiveObject.Spine=%2\n"
|
||||
"App.getDocument('%5').ActiveObject.Solid=%3\n"
|
||||
"App.getDocument('%5').ActiveObject.Frenet=%4\n"
|
||||
)
|
||||
.arg(list).arg(QLatin1String(objectName.c_str()))
|
||||
.arg(QLatin1String(subShape.c_str()))
|
||||
.arg(solid).arg(frenet).arg(QString::fromAscii(d->document.c_str()));
|
||||
.arg(list)
|
||||
.arg(QLatin1String(selection.c_str()))
|
||||
.arg(solid)
|
||||
.arg(frenet)
|
||||
.arg(QString::fromAscii(d->document.c_str()));
|
||||
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str());
|
||||
if (!doc) throw Base::Exception("Document doesn't exist anymore");
|
||||
|
@ -225,7 +226,8 @@ TaskSweep::TaskSweep()
|
|||
{
|
||||
widget = new SweepWidget();
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
QPixmap(), widget->windowTitle(), true, 0);
|
||||
Gui::BitmapFactory().pixmap("Part_Sweep"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@ SET(StartPage_Resources
|
|||
StartPage/PartDesignExample.png
|
||||
StartPage/ArchExample.png
|
||||
StartPage/web.png
|
||||
StartPage/blank.png
|
||||
StartPage/complete.jpg
|
||||
)
|
||||
|
||||
add_library(StartGui SHARED ${StartGui_SRCS})
|
||||
|
|
|
@ -24,6 +24,8 @@ SET(StartPage_DATA
|
|||
PartDesignExample.png
|
||||
ArchExample.png
|
||||
web.png
|
||||
blank.png
|
||||
complete.jpg
|
||||
)
|
||||
|
||||
INSTALL(FILES ${StartPage_SRCS}
|
||||
|
|
|
@ -28,7 +28,9 @@ data_DATA = \
|
|||
Complete.png \
|
||||
PartDesignExample.png \
|
||||
ArchExample.png \
|
||||
web.png
|
||||
web.png \
|
||||
blank.png \
|
||||
complete.jpg
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(data_DATA) $(python_DATA)
|
||||
|
|
|
@ -309,10 +309,10 @@ def getWebExamples():
|
|||
def getExamples():
|
||||
return """
|
||||
<ul>
|
||||
<li><a href="LoadSchenkel.py">""" + text10 + """</a></li>
|
||||
<li><a href="LoadPartDesignExample.py">""" + text11 + """</a></li>
|
||||
<li><a href="LoadDrawingExample.py">""" + text12 + """</a></li>
|
||||
<li><a href="LoadRobotExample.py">""" + text13 + """</a></li>
|
||||
<li><img src="FreeCAD.png" style="width: 16px"> <a href="LoadSchenkel.py">""" + text10 + """</a></li>
|
||||
<li><img src="FreeCAD.png" style="width: 16px"> <a href="LoadPartDesignExample.py">""" + text11 + """</a></li>
|
||||
<li><img src="FreeCAD.png" style="width: 16px"> <a href="LoadDrawingExample.py">""" + text12 + """</a></li>
|
||||
<li><img src="FreeCAD.png" style="width: 16px"> <a href="LoadRobotExample.py">""" + text13 + """</a></li>
|
||||
</ul>"""
|
||||
|
||||
def getLinks():
|
||||
|
@ -366,7 +366,7 @@ def getWorkbenches():
|
|||
<li><img src="Complete.png">
|
||||
<a onMouseover="show('<h3>""" + text30 +"""</h3> \
|
||||
<p>This is the <b>""" + text31 + """</b>, \
|
||||
""" + text32 + """</p>')"
|
||||
""" + text32 + """</p><img src=complete.jpg>')"
|
||||
onMouseout="show('')"
|
||||
href="DefaultWorkbench.py">""" + text31 + """</a>
|
||||
</li>
|
||||
|
@ -399,7 +399,7 @@ def getInfo(filename):
|
|||
html += text35 + " " + getLocalTime(s.st_mtime) + "<br/>"
|
||||
html += "<span>" + text36 + " " + filename + "</span></p>"
|
||||
# get additional info from fcstd files
|
||||
if os.path.splitext(filename)[1] in [".fcstd",".FcStd"]:
|
||||
if os.path.splitext(filename)[1].upper() in [".FCSTD"]:
|
||||
zfile=zipfile.ZipFile(filename)
|
||||
files=zfile.namelist()
|
||||
# check for meta-file if it's really a FreeCAD document
|
||||
|
@ -429,7 +429,12 @@ def getRecentFiles():
|
|||
if i < ct:
|
||||
mr = rf.GetString("MRU%d" % (i))
|
||||
fn = os.path.basename(mr)
|
||||
html += '<li><a '
|
||||
html += '<li>'
|
||||
if mr[-5:].upper() == "FCSTD":
|
||||
html += '<img src="FreeCAD.png" style="width: 16px"> '
|
||||
else:
|
||||
html += '<img src="blank.png" style="width: 16px"> '
|
||||
html += '<a '
|
||||
html += 'onMouseover="show(\''+getInfo(mr)+'\')" '
|
||||
html += 'onMouseout="show(\'\')" '
|
||||
html += 'href="LoadMRU'+str(i)+'.py">'
|
||||
|
|
BIN
src/Mod/Start/StartPage/blank.png
Executable file
BIN
src/Mod/Start/StartPage/blank.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 302 B |
BIN
src/Mod/Start/StartPage/complete.jpg
Normal file
BIN
src/Mod/Start/StartPage/complete.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user