add base lines

This commit is contained in:
Stefan Tröger
2015-05-05 07:05:09 +02:00
parent 09660ea84d
commit b401f07bdf
12 changed files with 735 additions and 2 deletions

View File

@@ -96,6 +96,7 @@
#include "MeasureDistance.h"
#include "Placement.h"
#include "Plane.h"
#include "Line.h"
#include "Part.h"
#include "MaterialObject.h"
#include "Expression.h"
@@ -1133,6 +1134,7 @@ void Application::initTypes(void)
App ::MaterialObjectPython ::init();
App ::Placement ::init();
App ::Plane ::init();
App ::Line ::init();
App ::Part ::init();
// Expression classes

View File

@@ -84,6 +84,7 @@ SET(Document_CPP_SRCS
Placement.cpp
Plane.cpp
Range.cpp
Line.cpp
Transactions.cpp
VRMLObject.cpp
MaterialObject.cpp
@@ -114,6 +115,7 @@ SET(Document_HPP_SRCS
Placement.h
Plane.h
Range.h
Line.h
Transactions.h
VRMLObject.h
MaterialObject.h

225
src/App/CMakeLists.txt.orig Normal file
View File

@@ -0,0 +1,225 @@
if(WIN32)
add_definitions(-DFCApp)
add_definitions(-DBOOST_DYN_LINK)
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(DOCDIR)
add_definitions(-DDOCDIR="${DOCDIR}")
ENDIF(DOCDIR)
include_directories(
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${XercesC_INCLUDE_DIRS}
${QT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
)
set(FreeCADApp_LIBS
FreeCADBase
${Boost_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTXML_LIBRARY}
)
generate_from_xml(DocumentPy)
generate_from_xml(DocumentObjectPy)
generate_from_xml(DocumentObjectGroupPy)
generate_from_xml(GeoFeaturePy)
generate_from_xml(GeoFeatureGroupPy)
generate_from_xml(PartPy)
generate_from_xml(ComplexGeoDataPy)
generate_from_xml(PropertyContainerPy)
generate_from_xml(MaterialPy)
generate_from_py(FreeCADInit InitScript.h)
generate_from_py(FreeCADTest TestScript.h)
SET(FreeCADApp_XML_SRCS
DocumentObjectGroupPy.xml
DocumentObjectPy.xml
GeoFeaturePy.xml
GeoFeatureGroupPy.xml
PartPy.xml
DocumentPy.xml
PropertyContainerPy.xml
ComplexGeoDataPy.xml
MaterialPy.xml
)
SOURCE_GROUP("XML" FILES ${FreeCADApp_XML_SRCS})
# The document stuff
SET(Document_CPP_SRCS
Annotation.cpp
Document.cpp
DocumentObject.cpp
DocumentObjectFileIncluded.cpp
DocumentObjectGroup.cpp
DocumentObjectGroupPyImp.cpp
PartPyImp.cpp
GeoFeaturePyImp.cpp
DocumentObjectPyImp.cpp
DocumentObserver.cpp
DocumentObserverPython.cpp
DocumentPyImp.cpp
Expression.cpp
FeaturePython.cpp
FeatureTest.cpp
GeoFeature.cpp
GeoFeatureGroupPyImp.cpp
GeoFeatureGroup.cpp
Part.cpp
Path.cpp
InventorObject.cpp
MeasureDistance.cpp
Placement.cpp
Plane.cpp
<<<<<<< 328aeaab9aed22c3b94c79bd7e49404342a44cea
Range.cpp
=======
Line.cpp
>>>>>>> add base lines
Transactions.cpp
VRMLObject.cpp
MaterialObject.cpp
MergeDocuments.cpp
)
SET(Document_HPP_SRCS
Annotation.h
Document.h
DocumentObject.h
DocumentObjectFileIncluded.h
DocumentObjectGroup.h
DocumentObserver.h
DocumentObserverPython.h
Expression.h
ExpressionVisitors.h
FeatureCustom.h
FeaturePython.h
FeaturePythonPyImp.h
FeaturePythonPyImp.inl
FeatureTest.h
GeoFeature.h
GeoFeatureGroup.h
Part.h
Path.h
InventorObject.h
MeasureDistance.h
Placement.h
Plane.h
<<<<<<< 328aeaab9aed22c3b94c79bd7e49404342a44cea
Range.h
=======
Line.h
>>>>>>> add base lines
Transactions.h
VRMLObject.h
MaterialObject.h
MergeDocuments.h
)
SET(Document_SRCS
${Document_CPP_SRCS}
${Document_HPP_SRCS}
)
SOURCE_GROUP("Document" FILES ${Document_SRCS})
# The property stuff
SET(Properties_CPP_SRCS
DynamicProperty.cpp
ObjectIdentifier.cpp
Property.cpp
PropertyContainer.cpp
PropertyContainerPyImp.cpp
PropertyFile.cpp
PropertyGeo.cpp
PropertyLinks.cpp
PropertyPythonObject.cpp
PropertyStandard.cpp
PropertyUnits.cpp
PropertyExpressionEngine.cpp
)
SET(Properties_HPP_SRCS
DynamicProperty.h
ObjectIdentifier.h
Property.h
PropertyContainer.h
PropertyFile.h
PropertyGeo.h
PropertyLinks.h
PropertyPythonObject.h
PropertyStandard.h
PropertyUnits.h
PropertyExpressionEngine.h
)
SET(Properties_SRCS
${Properties_CPP_SRCS}
${Properties_HPP_SRCS}
)
SOURCE_GROUP("Properties" FILES ${Properties_SRCS})
SET(FreeCADApp_CPP_SRCS
${Document_CPP_SRCS}
${Properties_CPP_SRCS}
Application.cpp
ApplicationPy.cpp
Branding.cpp
ColorModel.cpp
ComplexGeoData.cpp
ComplexGeoDataPyImp.cpp
Enumeration.cpp
Material.cpp
MaterialPyImp.cpp
)
SET(FreeCADApp_HPP_SRCS
${Document_HPP_SRCS}
${Properties_HPP_SRCS}
Application.h
Branding.h
ColorModel.h
ComplexGeoData.h
Enumeration.h
Material.h
)
SET(FreeCADApp_SRCS
${FreeCADApp_CPP_SRCS}
${FreeCADApp_HPP_SRCS}
${FreeCADApp_XML_SRCS}
FreeCADInit.py
FreeCADTest.py
PreCompiled.cpp
PreCompiled.h
)
if(MSVC)
add_definitions(-D_PreComp_)
ADD_MSVC_PRECOMPILED_HEADER(FreeCADApp PreCompiled.h PreCompiled.cpp FreeCADApp_CPP_SRCS)
endif(MSVC)
add_library(FreeCADApp SHARED ${FreeCADApp_SRCS})
target_link_libraries(FreeCADApp ${FreeCADApp_LIBS})
SET_BIN_DIR(FreeCADApp FreeCADApp)
if(WIN32)
INSTALL(TARGETS FreeCADApp
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else(WIN32)
INSTALL(TARGETS FreeCADApp
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif(WIN32)

61
src/App/Line.cpp Normal file
View File

@@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (c) Stefan Tröger (stefantroeger@gmx.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include "Line.h"
using namespace App;
PROPERTY_SOURCE(App::Line, App::GeoFeature)
//===========================================================================
// Feature
//===========================================================================
Line::Line(void)
{
ADD_PROPERTY(LineType,(""));
}
Line::~Line(void)
{
}
Base::BoundBox3d Line::getBoundBox()
{
return Base::BoundBox3d(-10, -10, -10, 10, 10, 10);
}

69
src/App/Line.h Normal file
View File

@@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2012 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef _AppLine_h_
#define _AppLine_h_
#include "GeoFeature.h"
#include "PropertyGeo.h"
namespace App
{
/** Line Object
* Used to define planar support for all kind of operations in the document space
*/
class AppExport Line: public App::GeoFeature
{
PROPERTY_HEADER(App::Line);
public:
/// Constructor
Line(void);
virtual ~Line();
/// additional information about the plane usage (e.g. "BaseLine-xy" in a Part)
PropertyString LineType;
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "Gui::ViewProviderLine";
}
/// Return the bounding box of the plane (this is always a fixed size)
static Base::BoundBox3d getBoundBox();
};
} //namespace App
#endif

View File

@@ -46,6 +46,7 @@ PROPERTY_SOURCE(App::Part, App::GeoFeatureGroup)
const char* Part::BaseplaneTypes[3] = {"XY_Plane", "XZ_Plane", "YZ_Plane"};
const char* Part::BaselineTypes[3] = {"X_Axis", "Y_Axis", "Z_Axis"};
Part::Part(void)
{

View File

@@ -90,6 +90,7 @@ public:
virtual PyObject *getPyObject(void);
static const char* BaseplaneTypes[3];
static const char* BaselineTypes[3];
};
//typedef App::FeaturePythonT<Part> PartPython;