https://hal.archives-ouvertes.fr/hal-02398953
Raw File
Tip revision: c33910a29d53f4e137c225b21a8d59e43327cbf9 authored by Software Heritage on 08 December 2019, 12:26:32 UTC
hal: Deposit 351 in collection hal
Tip revision: c33910a
Prism.cpp
#include "Prism.h"
#include <cmath>
#include <iostream>
#include <string>

using namespace std;
using namespace giac;

Prism::Prism(){
};

void Prism::fillRidge(unsigned k) {
  //  cout << "Free ridges before filling #" << k << ": " << freeRidges << endl;
  freeRidges.erase(remove(freeRidges.begin(), freeRidges.end(), k),freeRidges.end());
  //  cout << "Free ridges after filling: " << freeRidges << endl;
  if (freeRidges.size()==0) {
    isSurrounded = true;
  }
}

void Prism::print() {
  cout << mirror.word << "; " << sides[jstart].word << ", " << sides[(jstart+1)%sides.size()].word << endl;
}

Prism Prism::mycopy() {
  Prism A;
  A.toppower=toppower;
  A.toporder=toporder;
  A.mirror = mirror;
  A.cspine = cspine;
  A.apex = apex;
  A.apexProjection = apexProjection;
  for (unsigned k=0; k<sides.size(); k++) {
    A.sides.push_back(WVector(sides[k].coords,sides[k].word));
  }
  for (unsigned k=0; k<bottomface.size(); k++) {
    A.bottomface.push_back(WVector(bottomface[k].coords,bottomface[k].word));
  }
  for (unsigned k=0; k<topface.size(); k++) {
    A.topface.push_back(WVector(topface[k].coords,topface[k].word));
  }
  for (unsigned k=0; k<midvertices.size(); k++) {
    A.midvertices.push_back(WVector(midvertices[k].coords,midvertices[k].word));
    A.midvertindices.push_back(midvertindices[k]);
  }
  A.isSurrounded = false;
  for (unsigned k=0; k<sides.size(); k++) {
    A.freeRidges.push_back(k);
    //    cout << A.sides[k].word << endl;
  }
  A.jstart = jstart;

  A.X0 = X0;
  A.X1 = X1;

  return A;
}

ostream & operator<<(ostream &out, const Prism &A)
{
  int ns = A.sides.size();
  //out << "[" << ns << "] " << convertword(A.mirror.word) << ";   " << convertword(A.sides[A.jstart].word) << ",   " << convertword(A.sides[(A.jstart+1)%ns].word);
  out << "[" << ns << "] " << convertword(A.mirror.word) << " | " ;
  for (unsigned k=0; k<ns-1; k++) {
    out << convertword(A.sides[(A.jstart+k)%ns].word) << "; " ;
  }
  out << convertword(A.sides[(A.jstart+ns-1)%ns].word) ;
  return out;
} 
back to top