37 #include <OpenGL/gl.h>
40 #include <vigra/windows.h>
54 helper->
SetStatusMessage(_(
"Drag a rectangle and select the desired action for the control points in the selected rectangle. Alt + drag to create a line control point."));
62 glDisable(GL_TEXTURE_2D);
65 if (
m_line || (fabs(dist.
x) > 10 && fabs(dist.
y) > 10))
67 glColor3f(1.0f, 1.0f, 0.0f);
72 glColor3f(0.7f, 0.7f, 0.7f);
94 glEnable(GL_TEXTURE_2D);
122 if (e.ButtonDown(wxMOUSE_BTN_LEFT) && !
m_mouseDown)
147 if (fabs(dist.
x) > 10 && fabs(dist.
y) > 10)
153 if (!roi.isEmpty() && roi.width() > 10 && roi.height() > 10)
155 menu.Append(
ID_CREATE_CP, _(
"Create control points here"));
160 menu.Append(
ID_REMOVE_CP, wxString::Format(_(
"Remove %lu control points"), static_cast<unsigned long int>(
m_CPinROI.size())));
162 if (!menu.GetMenuItems().IsEmpty())
195 if (!activeImages.empty())
198 typedef std::map<size_t, HuginBase::PTools::Transform*> TransformMap;
199 TransformMap transformations;
200 for (HuginBase::UIntSet::iterator it = activeImages.begin(); it != activeImages.end(); ++it)
204 transformations.insert(std::make_pair(*it, trans));
207 for (HuginBase::CPVector::const_iterator cpIt = cps.begin(); cpIt != cps.end(); ++cpIt)
215 if (transformations[cpIt->image1Nr]->transformImgCoord(pos1,
hugin_utils::FDiff2D(cpIt->x1, cpIt->y1)) &&
216 transformations[cpIt->image2Nr]->transformImgCoord(pos2,
hugin_utils::FDiff2D(cpIt->x2, cpIt->y2)))
218 if (panoPos1.
x <= pos1.
x && pos1.
x <= panoPos2.
x && panoPos1.
y <= pos1.
y && pos1.
y <= panoPos2.
y &&
219 panoPos1.
x <= pos2.
x && pos2.
x <= panoPos2.
x && panoPos1.
y <= pos2.
y && pos2.
y <= panoPos2.
y)
226 for (TransformMap::iterator it = transformations.begin(); it != transformations.end(); ++it)
258 std::set_intersection(imgs1.begin(), imgs1.end(), imgs2.begin(), imgs2.end(), std::inserter(imgIntersection, imgIntersection.begin()));
259 if (!imgIntersection.empty())
264 cp.
image1Nr = *imgIntersection.begin();
268 double image_x, image_y;
276 if (abs(pos1.
x - pos2.
x) < abs(pos1.
y - pos2.
y))
bool set_contains(const _Container &c, const typename _Container::key_type &key)
include file for the hugin project
void ForceRequireRedraw()
const CPVector & getCtrlPoints() const
get all control point of this Panorama
represents a control point
std::set< unsigned int > UIntSet
wxwindows specific panorama commands
evaluate x, points are on a vertical line
static GlobalCmdHist & getInstance()
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
UIntSet getActiveImages() const
get active images
include file for the hugin project
const PanoramaOptions & getOptions() const
returns the options for this panorama
std::vector< ControlPoint > CPVector
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
vigra::Size2D getSize() const
get size of output image
evaluate y, points are on a horizontal line