remove gui dependencies in app

This commit is contained in:
Stefan Tröger
2013-05-05 17:40:57 +02:00
committed by Stefan Tröger
parent bf447d3a7c
commit 35a9f1c693
10 changed files with 506 additions and 19 deletions

View File

@@ -4,10 +4,6 @@ else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions( -DUSE_LOGGING )
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
include_directories(
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
@@ -28,11 +24,6 @@ set(Assembly_LIBS
${OCC_LIBRARIES}
Part
FreeCADApp
boost_log
rt
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
)
generate_from_xml(ItemPy)

View File

@@ -46,6 +46,7 @@
#include <Base/Console.h>
#include "Constraint.h"
#include "ConstraintPy.h"
#include "Item.h"
#include "ItemPart.h"
@@ -109,5 +110,14 @@ void Constraint::init(boost::shared_ptr< Solver > solver) {
};
}
PyObject *Constraint::getPyObject(void)
{
if (PythonObject.is(Py::_None())){
// ref counter is set to 1
PythonObject = Py::Object(new ConstraintPy(this),true);
}
return Py::new_reference_to(PythonObject);
}
}

View File

@@ -59,6 +59,7 @@ public:
const char* getViewProviderName(void) const {
return "Gui::ViewProviderDocumentObject";
}
PyObject *getPyObject(void);
/** @brief initialize the constraint in the assembly solver
*/

View File

@@ -45,7 +45,7 @@ public:
short mustExecute() const;
/// returns the type name of the view provider
//const char* getViewProviderName(void) const {
// return "PartDesignGui::ViewProviderConstraintFix";
// return "AssemblyGui::ViewProviderConstraintFix";
//}
//@}
};

View File

@@ -58,6 +58,8 @@ PyObject *ConstraintGroup::getPyObject(void)
void ConstraintGroup::addConstraint(Constraint* c)
{
Base::Console().Message("add constraint to group\n");
//add the constraint to our list
const std::vector< App::DocumentObject * > &vals = this->Constraints.getValues();
std::vector< App::DocumentObject * > newVals(vals);

View File

@@ -30,7 +30,6 @@
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Cylinder.hxx>
#include <Inventor/SbVec3f.h>
#include "opendcm/core.hpp"
#include "opendcm/module3d.hpp"
@@ -312,18 +311,11 @@ struct geometry_traits<Base::Placement> {
typedef modell::quaternion_wxyz_vec3 modell;
typedef placement_accessor accessor;
};
template<>
struct geometry_traits<SbVec3f> {
typedef tag::point3D tag;
typedef modell::XYZ modell;
typedef orderd_bracket_accessor accessor;
};
}
//our constraint solving system
typedef dcm::Kernel<double> Kernel;
typedef dcm::Module3D< mpl::vector5< gp_Pnt, gp_Lin, gp_Pln, gp_Cylinder, SbVec3f>, std::string > Module3D;
typedef dcm::Module3D< mpl::vector4< gp_Pnt, gp_Lin, gp_Pln, gp_Cylinder>, std::string > Module3D;
typedef dcm::ModulePart< mpl::vector1< Base::Placement >, std::string > ModulePart;
typedef dcm::System<Kernel, Module3D, ModulePart> Solver;