~ubuntu-branches/ubuntu/utopic/gnome-chemistry-utils/utopic-proposed

« back to all changes in this revision

Viewing changes to plugins/paint/cycles/cycletool.cc

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-10 21:30:51 UTC
  • mfrom: (1.1.15) (2.1.25 sid)
  • Revision ID: package-import@ubuntu.com-20130510213051-mswxsp3vitsgqspm
Tags: 0.14.2-1ubuntu1
* Sync with Debian. Remaining change:
  - Build-depend on firefox-dev instead of xulrunner-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- C++ -*-
2
2
 
3
 
/* 
 
3
/*
4
4
 * GChemPaint cycles plugin
5
 
 * cycletool.cc 
6
 
 *
7
 
 * Copyright (C) 2001-2008 Jean Bréfort <jean.brefort@normalesup.org>
8
 
 *
9
 
 * This program is free software; you can redistribute it and/or 
10
 
 * modify it under the terms of the GNU General Public License as 
11
 
 * published by the Free Software Foundation; either version 2 of the
 
5
 * cycletool.cc
 
6
 *
 
7
 * Copyright (C) 2001-2011 Jean Bréfort <jean.brefort@normalesup.org>
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU General Public License as
 
11
 * published by the Free Software Foundation; either version 3 of the
12
12
 * License, or (at your option) any later version.
13
13
 *
14
14
 * This program is distributed in the hope that it will be useful,
37
37
#include <gccv/canvas.h>
38
38
#include <gccv/group.h>
39
39
#include <gccv/line.h>
40
 
#include <gcu/ui-builder.h>
 
40
#include <gcugtk/ui-builder.h>
41
41
#include <glib/gi18n-lib.h>
42
42
#include <cmath>
43
43
#include <list>
229
229
                                        while ((pBond = (gcp::Bond*) pAtom->GetNextBond (j))) {
230
230
                                                k = 0;
231
231
                                                a0 = pBond->GetAngle2DRad (pAtom);
232
 
                                                while ((a0 > orientations[k]) && (k < orientations.size ())) 
 
232
                                                while ((a0 > orientations[k]) && (k < orientations.size ()))
233
233
                                                        k++;
234
234
                                                orientations.insert (orientations.begin () + k, a0);
235
235
                                        }
269
269
                m_Points[i].x = x1 += m_dLength * cos (m_dAngle - m_dDev * (i - 1));
270
270
                m_Points[i].y = y1 -= m_dLength * sin (m_dAngle - m_dDev * (i - 1));
271
271
        }
272
 
        
 
272
 
273
273
        m_bAllowed = CheckIfAllowed ();
274
274
        Draw ();
275
275
        return true;
498
498
        gcp::Molecule *pMol = NULL;
499
499
        std::string MolId;
500
500
        int i;
 
501
        // first save groups if any will be modified
501
502
        for (i = 0; i < m_size; i++) {
502
503
                m_x = m_Points[i].x;
503
504
                m_y = m_Points[i].y;
531
532
                                }
532
533
                        }
533
534
                }
 
535
        }
 
536
        // now add missing atoms and bonds
 
537
        for (i = 0; i < m_size; i++) {
534
538
                if (!pAtom[i]) {
535
539
                        pAtom[i] = new gcp::Atom (m_pApp->GetCurZ (), m_Points[i].x / m_dZoomFactor, m_Points[i].y / m_dZoomFactor, 0);
536
540
                        pDoc->AddAtom (pAtom[i]);
699
703
 
700
704
GtkWidget *gcpCycleTool::GetPropertyPage ()
701
705
{
702
 
        gcu::UIBuilder *builder = new gcu::UIBuilder (UIDIR"/cycle.ui", GETTEXT_PACKAGE);
 
706
        gcugtk::UIBuilder *builder = new gcugtk::UIBuilder (UIDIR"/cycle.ui", GETTEXT_PACKAGE);
703
707
        m_LengthBtn = GTK_SPIN_BUTTON (builder->GetWidget ("bond-length"));
704
708
        g_signal_connect (m_LengthBtn, "value-changed", G_CALLBACK (on_length_changed), this);
705
709
        m_MergeBtn = GTK_TOGGLE_BUTTON (builder->GetWidget ("merge"));
757
761
 
758
762
GtkWidget *gcpNCycleTool::GetPropertyPage ()
759
763
{
760
 
        gcu::UIBuilder *builder = new gcu::UIBuilder (UIDIR"/cyclen.ui", GETTEXT_PACKAGE);
 
764
        gcugtk::UIBuilder *builder = new gcugtk::UIBuilder (UIDIR"/cyclen.ui", GETTEXT_PACKAGE);
761
765
        m_LengthBtn = GTK_SPIN_BUTTON (builder->GetWidget ("bond-length"));
762
766
        g_signal_connect (m_LengthBtn, "value-changed", G_CALLBACK (on_length_changed), this);
763
767
        m_MergeBtn = GTK_TOGGLE_BUTTON (builder->GetWidget ("merge"));