SET(SHAPER_INSTALL_TUI_DOC doc CACHE INTERNAL "" FORCE)
ENDIF(${HAVE_SALOME})
+# Sketcher: Change radius of circular edges while dragging a point on the edge
+SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE FALSE)
+
ADD_SUBDIRECTORY (src/Config)
ADD_SUBDIRECTORY (src/Events)
ADD_SUBDIRECTORY (src/Model)
TestTrimCircleAndArc01.py
TestTrimLine01.py
TestTrimLine02.py
- TestMovePoint.py
- TestMoveLine.py
- TestMoveCircle.py
- TestMoveArc.py
- TestMovementComplex.py
TestDistanceSignedVsUnsigned01.py
TestDistanceSignedVsUnsigned02.py
TestDistanceSignedVsUnsigned03.py
TestSignedDistancePointPoint.py
TestSignedDistancePointLine.py
)
+
+if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE})
+ ADD_UNIT_TESTS(
+ TestMovePoint.py
+ TestMoveLine.py
+ TestMoveCircle.py
+ TestMoveArc.py
+ TestMovementComplex.py
+ )
+endif()
\ No newline at end of file
${SKETCHSOLVER_CONSTRAINT_SOURCES}
)
+if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE})
+ ADD_DEFINITIONS(-DCHANGE_RADIUS_WHILE_MOVE)
+endif()
+
ADD_LIBRARY(PlaneGCSSolver MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${SKETCHSOLVER_TEXT_RESOURCES})
TARGET_LINK_LIBRARIES(PlaneGCSSolver ${PROJECT_LIBRARIES} ${SKETCHSOLVER_LIBRARIES})
INSTALL(TARGETS PlaneGCSSolver DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
static bool isSimpleMove(FeaturePtr theMovedFeature, AttributePtr theDraggedPoint)
{
bool isSimple = true;
+#ifdef CHANGE_RADIUS_WHILE_MOVE
if (theMovedFeature->getKind() == SketchPlugin_Circle::ID())
isSimple = (theDraggedPoint.get() != 0);
else if (theMovedFeature->getKind() == SketchPlugin_Arc::ID()) {
isSimple = (theDraggedPoint.get() != 0 &&
theDraggedPoint->id() == SketchPlugin_Arc::CENTER_ID());
}
+#endif
return isSimple;
}
double aDelta[2] = { theDestinationPoint->x() - myStartPoint->x(),
theDestinationPoint->y() - myStartPoint->y() };
+#ifdef CHANGE_RADIUS_WHILE_MOVE
int aMaxSize = mySimpleMove ? (int)myFixedValues.size() : 2;
+#else
+ int aMaxSize = myMovedFeature->getKind() == SketchPlugin_Line::ID() && !myDraggedPoint ? 4 : 2;
+#endif
for (int i = 0; i < aMaxSize; ++i)
myFixedValues[i] += aDelta[i % 2];
}