--- /dev/null
+SET(SLVS_ROOT_DIR $ENV{SOLVESPACE_ROOT_DIR})
+
+INCLUDE_DIRECTORIES(${SLVS_ROOT_DIR}/include)
+LINK_DIRECTORIES(${SLVS_ROOT_DIR}/lib)
+
+SET(SLVS_LIBRARIES ${SLVS_ROOT_DIR}/lib/slvs.lib)
INCLUDE(FindBoost)
INCLUDE(FindPython)
INCLUDE(FindSalome)
+INCLUDE(FindSolveSpace)
IF(UNIX)
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_SUBDIRECTORY (src/PartSetPlugin)
ADD_SUBDIRECTORY (src/ConstructionPlugin)
ADD_SUBDIRECTORY (src/SketchPlugin)
+ADD_SUBDIRECTORY (src/SketchSolver)
ADD_SUBDIRECTORY (src/ModuleBase)
ADD_SUBDIRECTORY (src/PartSet)
ADD_SUBDIRECTORY (src/PyConsole)
export LIBXML2_LIB_DIR=${LIBXML2_ROOT_DIR}/lib
export LIBXML2_BIN_DIR=${LIBXML2_ROOT_DIR}/bin
##
+#------ SolveSpace ------
+export SOLVESPACE_ROOT_DIR=${PDIR}/solvespace-2.0
+export LD_LIBRARY_PATH=${SOLVESPACE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
+##
#------ OCCT ------
export CAS_ROOT_DIR=${PDIR}/OCCT-6.7.0
@SET PATH=%BOOST_ROOT_DIR%\lib;%PATH%
@REM -------------------------
+@REM -------------------------
+@SET SOLVESPACE_ROOT_DIR=%PDIR%\solvespace-2.0
+@SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
+@REM -------------------------
+
@SET NEW_GEOM_CONFIG_FILE=%ROOT_DIR%\install\plugins
@SET PATH=%ROOT_DIR%\install\plugins;%PATH%
SketchPlugin_Plugin.h
SketchPlugin_Sketch.h
SketchPlugin_Line.h
+ SketchPlugin_Point.h
)
SET(PROJECT_SOURCES
SketchPlugin_Plugin.cpp
SketchPlugin_Sketch.cpp
SketchPlugin_Line.cpp
+ SketchPlugin_Point.cpp
)
SET(PROJECT_LIBRARIES
--- /dev/null
+// File: SketchPlugin_Point.cpp
+// Created: 07 May 2014
+// Author: Artem ZHIDKOV
+
+#include "SketchPlugin_Point.h"
+#include "SketchPlugin_Sketch.h"
+#include <ModelAPI_Data.h>
+////#include <GeomAPI_Pnt.h>
+////#include <GeomAlgoAPI_EdgeBuilder.h>
+#include <GeomDataAPI_Point2D.h>
+
+using namespace std;
+
+////// face of the square-face displayed for selection of general plane
+////const double PLANE_SIZE = 200;
+
+SketchPlugin_Point::SketchPlugin_Point()
+{
+}
+
+void SketchPlugin_Point::initAttributes()
+{
+ data()->addAttribute(POINT_ATTR_COORD, GeomDataAPI_Point2D::type());
+}
+
+void SketchPlugin_Point::execute()
+{
+}
+
+const boost::shared_ptr<GeomAPI_Shape>& SketchPlugin_Point::preview()
+{
+ SketchPlugin_Sketch* aSketch = sketch();
+ // compute a point in 3D view
+ boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
+ boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(data()->attribute(POINT_ATTR_COORD));
+ boost::shared_ptr<GeomAPI_Pnt> aPoint3D(aSketch->to3D(aPoint->x(), aPoint->y()));
+ // make a visible point
+ //boost::shared_ptr<GeomAPI_Shape> anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd);
+ //setPreview(anEdge);
+
+ return getPreview();
+}
--- /dev/null
+// File: SketchPlugin_Point.h
+// Created: 07 May 2014
+// Author: Artem ZHIDKOV
+
+#ifndef SketchPlugin_Point_HeaderFile
+#define SketchPlugin_Point_HeaderFile
+
+#include "SketchPlugin.h"
+#include "SketchPlugin_Feature.h"
+#include <list>
+
+/// Coordinates of the point
+const std::string POINT_ATTR_COORD("PointCoordindates");
+
+/**\class SketchPlugin_Point
+ * \ingroup DataModel
+ * \brief Feature for creation of a new point.
+ */
+class SketchPlugin_Point: public SketchPlugin_Feature
+{
+public:
+ /// Returns the kind of a feature
+ SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
+ {static std::string MY_KIND = "SketchPoint"; return MY_KIND;}
+
+ /// Returns to which group in the document must be added feature
+ SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
+ {static std::string MY_GROUP = "Sketch"; return MY_GROUP;}
+
+ /// Creates a new part document if needed
+ SKETCHPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ SKETCHPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Returns the sketch preview
+ SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
+
+ /// Adds sub-feature of the higher level feature (sub-element of the sketch)
+ /// \param theFeature sub-feature
+ SKETCHPLUGIN_EXPORT virtual const void addSub(
+ const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
+
+ /// Use plugin manager for features creation
+ SketchPlugin_Point();
+};
+
+#endif
<label text="Select a plane on which to create a sketch" tooltip="Select a plane on which to create a sketch"/>
<!--icon=":pictures/x_point.png"-->
</feature>
+ <feature id="SketchPoint" text="Point" tooltip="Create a new point" icon=":icons/point.png" />
<feature id="SketchLine" text="Line" tooltip="Create a new line" icon=":icons/line.png">
<point_selector id="StartPoint" title="Start point" tooltip="Start point of the line"/>
<point_selector id="EndPoint" title="End point" tooltip="End point of the line"/>
--- /dev/null
+INCLUDE(Common)
+INCLUDE(FindSolveSpace)
+
+SET(PROJECT_HEADERS
+ SketchSolver.h
+ SketchSolver_Solver.h
+)
+
+SET(PROJECT_SOURCES
+ SketchSolver_Solver.cpp
+)
+
+SET(PROJECT_LIBRARIES
+ ${SLVS_LIBRARIES}
+ SketchPlugin
+)
+
+SET(INCLUDE_DIRECTORIES
+ ../SketchPlugin
+)
+
+ADD_LIBRARY(SketchSolver SHARED
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+)
+
+TARGET_LINK_LIBRARIES(SketchSolver
+ ${PROJECT_LIBRARIES}
+)
+
+INSTALL(TARGETS SketchSolver DESTINATION plugins)
--- /dev/null
+#ifndef SKETCHSOLVER_H
+#define SKETCHSOLVER_H
+
+#if defined SKETCHSOLVER_EXPORTS
+#if defined WIN32
+#define SKETCHSOLVER_EXPORT __declspec( dllexport )
+#else
+#define SKETCHSOLVER_EXPORT
+#endif
+#else
+#if defined WIN32
+#define SKETCHSOLVER_EXPORT __declspec( dllimport )
+#else
+#define SKETCHSOLVER_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+// File: SketchSolver_Solver.cpp
+// Created: 07 May 2014
+// Author: Artem ZHIDKOV
+
+#include "SketchSolver_Solver.h"
--- /dev/null
+// File: SketchSolver_Solver.h
+// Created: 07 May 2014
+// Author: Artem ZHIDKOV
+
+#ifndef SketchSolver_Solver_Headerfile
+#define SketchSolver_Solver_Headerfile
+
+#include "SketchSolver.h"
+
+#endif