37 #include <OpenGL/gl.h>
40 #include <vigra/windows.h>
55 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."));
71 glDisable(GL_TEXTURE_2D);
74 if (
m_line || (fabs(dist.
x) > 10 && fabs(dist.
y) > 10))
76 glColor3f(1.0f, 1.0f, 0.0f);
81 glColor3f(0.7f, 0.7f, 0.7f);
103 glEnable(GL_TEXTURE_2D);
131 if (e.ButtonDown(wxMOUSE_BTN_LEFT) && !
m_mouseDown)
156 if (fabs(dist.
x) > 10 && fabs(dist.
y) > 10)
162 if (!roi.isEmpty() && roi.width() > 10 && roi.height() > 10)
164 menu.Append(
ID_CREATE_CP, _(
"Create control points here"));
169 menu.Append(
ID_REMOVE_CP, wxString::Format(_(
"Remove %lu control points"), static_cast<unsigned long int>(
m_CPinROI.size())));
171 if (!menu.GetMenuItems().IsEmpty())
204 if (!activeImages.empty())
207 typedef std::map<size_t, HuginBase::PTools::Transform*> TransformMap;
208 TransformMap transformations;
209 for (HuginBase::UIntSet::iterator it = activeImages.begin(); it != activeImages.end(); ++it)
213 transformations.insert(std::make_pair(*it, trans));
216 for (HuginBase::CPVector::const_iterator cpIt = cps.begin(); cpIt != cps.end(); ++cpIt)
224 if (transformations[cpIt->image1Nr]->transformImgCoord(pos1,
hugin_utils::FDiff2D(cpIt->x1, cpIt->y1)) &&
225 transformations[cpIt->image2Nr]->transformImgCoord(pos2,
hugin_utils::FDiff2D(cpIt->x2, cpIt->y2)))
227 if (panoPos1.
x <= pos1.
x && pos1.
x <= panoPos2.
x && panoPos1.
y <= pos1.
y && pos1.
y <= panoPos2.
y &&
228 panoPos1.
x <= pos2.
x && pos2.
x <= panoPos2.
x && panoPos1.
y <= pos2.
y && pos2.
y <= panoPos2.
y)
235 for (TransformMap::iterator it = transformations.begin(); it != transformations.end(); ++it)
266 if (imgs1.empty() || imgs2.empty())
277 std::set_intersection(imgs1.begin(), imgs1.end(), imgs2.begin(), imgs2.end(), std::inserter(imgIntersection, imgIntersection.begin()));
280 if (!imgIntersection.empty())
283 cp.
image1Nr = *imgIntersection.begin();
286 double image_x, image_y;
303 double image_x, image_y;
312 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