Exemple #1
0
static void get_conventional_lattice(double lattice[3][3],
				     SPGCONST Spacegroup *spacegroup)
{
  int i, j;
  double metric[3][3];
  Pointgroup pointgroup;

  pointgroup = ptg_get_pointgroup(spacegroup->pointgroup_number);

  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      lattice[i][j] = 0;
    }
  }

  mat_get_metric(metric, spacegroup->bravais_lattice);

  debug_print("bravais lattice\n");
  debug_print_matrix_d3(spacegroup->bravais_lattice);
  debug_print("%s\n", spacegroup->setting);

  switch (pointgroup.holohedry) {
  case TRICLI:
    set_tricli(lattice, metric);
    break;
  case MONOCLI: /* b-axis is the unique axis. */
    set_monocli(lattice, metric);
    break;
  case ORTHO:
    set_ortho(lattice, metric);
    break;
  case TETRA:
    set_tetra(lattice, metric);
    break;
  case TRIGO:
    if (spacegroup->setting[0] == 'R') {
      set_rhomb(lattice, metric);
    } else {
      set_trigo(lattice, metric);
    }
    break;
  case HEXA:
    set_trigo(lattice, metric);
    break;
  case CUBIC:
    set_cubic(lattice, metric);
    break;
  case HOLOHEDRY_NONE:
    break;
  }
}
Exemple #2
0
static int get_conventional_lattice(double lattice[3][3],
                                    const Holohedry holohedry,
                                    SPGCONST double bravais_lattice[3][3])
{
    int i, j;
    double metric[3][3];

    for (i = 0; i < 3; i++) {
        for (j = 0; j < 3; j++) {
            lattice[i][j] = 0;
        }
    }

    mat_get_metric(metric, bravais_lattice);

    switch (holohedry) {
    case TRICLI:
        mat_copy_matrix_d3(lattice, bravais_lattice);
        break;
    case MONOCLI: /* b-axis is the unique axis. */
        set_monocli(lattice, metric);
        break;
    case ORTHO:
        set_ortho(lattice, metric);
        break;
    case TETRA:
        set_tetra(lattice, metric);
        break;
    case RHOMB:
        set_rhomb(lattice, metric);
        break;
    case TRIGO:
        set_trigo(lattice, metric);
        break;
    case HEXA:
        set_trigo(lattice, metric);
        break;
    case CUBIC:
        set_cubic(lattice, metric);
        break;
    case NONE:
        break;
    }

    return 1;
}
Exemple #3
0
 void set_ortho() { set_ortho(0,0, width(), height()); }
Exemple #4
0
Fichier : Panner.C Projet : 0mk/non
int
Panner::handle ( int m )
{
    int r = Fl_Group::handle( m );

    switch ( m )
    {
        case FL_ENTER:
        case FL_LEAVE:
            _projection_choice->value(_projection_mode);
            _range_choice->value(_range_mode);
            redraw();
            return 1;
        case FL_PUSH:
        {
            if ( Fl::event_button1() || Fl::event_button3() )
                drag = event_point();

            if ( Fl::event_button2() )
            {
                /* if ( _projection == POLAR ) */
                /*     _projection = ORTHO; */
                /* else */
                /*     _projection = POLAR; */
            }
            return 1;
        }
        case FL_RELEASE:
            if ( drag )
            {
                do_callback();
                drag = NULL;
                redraw();
                return 1;
            }
            else
                return 0;
        case FL_MOUSEWHEEL:
        {
/*             Point *p = event_point(); */

/*             if ( p ) */
/*                 drag = p; */

/*             if ( drag ) */
/*             { */
/* //                drag->elevation( drag->elevation() + Fl::event_dy()); */
/*                 drag->elevation( 0 - drag->elevation() ); */
/*                 do_callback(); */
/*                 redraw(); */
/*                 return 1; */
/*             } */

            return 1;
        }
        case FL_DRAG:
        {
            if ( ! drag )
                return 0;

            int tx, ty, tw, th;
            bbox( tx, ty, tw, th );

            float X = (float(Fl::event_x() - tx) / tw ) - 0.5f;
            float Y = (float(Fl::event_y() - ty) / th) - 0.5f;
            
            if ( Fl::event_button1() )
            {
                if ( POLAR == projection() )
                    set_polar( drag,X,Y );
                else
                {
                    if ( fabsf( X ) < 0.5f &&
                         fabsf( Y ) < 0.5f ) 
                        set_ortho( drag, X,Y );
                }
            }
            else
                set_polar_radius( drag,X,Y );

            if ( when() & FL_WHEN_CHANGED )
                do_callback();

            damage(FL_DAMAGE_EXPOSE);

            return 1;
        }

    }

    return r;

//    return 0;
}