Ejemplo n.º 1
0
void ImagesPanel::OnLensTypeChanged (wxCommandEvent & e)
{
    size_t var = GetSelectedValue(m_lenstype);
    HuginBase::UIntSet images = m_images_tree->GetSelectedImages();
    if(images.size()>0)
    {
        const HuginBase::SrcPanoImage & img = m_pano->getImage(*(images.begin()));
        double focal_length = HuginBase::SrcPanoImage::calcFocalLength(img.getProjection(), img.getHFOV(), img.getCropFactor(), img.getSize());
        std::vector<PanoCommand::PanoCommand*> commands;
        commands.push_back(new PanoCommand::ChangeImageProjectionCmd(*m_pano, images,(HuginBase::SrcPanoImage::Projection) var));
        commands.push_back(new PanoCommand::UpdateFocalLengthCmd(*m_pano, images, focal_length));
        PanoCommand::GlobalCmdHist::getInstance().addCommand(
            new PanoCommand::CombinedPanoCommand(*m_pano, commands)
        );
    };
};
Ejemplo n.º 2
0
Widget* FileListBox::ClickUp(const Point2i & mousePosition, uint button)
{
  if (!Contains(mousePosition))
    return NULL;

  ItemBox::ClickUp(mousePosition, button);

  const std::string *name = (std::string*)GetSelectedValue();
  if (name && DoesFolderExist(*name)) {
    Uint32 now = SDL_GetTicks();

    // Check we didn't click too fast
    if (now - last_time > 1000)
      PopulateFileList(name->c_str());
    return NULL;
  }

  return (name) ? this : NULL;
}