shape_doc 0.1
algebraic_curve2d_test.cpp
# include <iostream>

# include <shape/viewer_axel.hpp>
# include <shape/semialgebraic_domain2d_axel.hpp>// for print_boxes
# include <shape/algebraic_curve.hpp>
# include <shape/topology2d.hpp>
# include <shape/cell2d_algebraic_curve.hpp>
# include <shape/graph.hpp>


using namespace std ;
using namespace mmx ;
using namespace shape ;

# define BoundingBox bounding_box<double>
# define Axel  viewer<axel>
# define AlgebraicCurve algebraic_curve<double>
# define Cell2dAlgebraicCurve cell2d_algebraic_curve<double>
# define Topology2d topology2d<double>

int main(int argc, char ** argv)
{
//  BoundingBox bx(-1,1,-1,1); //Bugs: curve crosses subdiv vertex, double point on inital box
  BoundingBox bx(-1.01,2.07,-1.03,1.01);
  AlgebraicCurve  cv((char *)"x^4+2*x^2*y^2+y^4-2*x^3-2*x*y^2-x^2-y^2+2*x");

  std::cout<<"Equation:  "<<cv.equation()<<std::endl;
    
  Cell2dAlgebraicCurve cl(&cv,bx);
  std::cout<<"Cell:  "<<cl.boundingBox()<<std::endl;

  Topology2d tp(bx);
  tp.push_back(&cv);
  tp.set_smoothness(0.02);
  tp.set_precision(0.05);
  tp.run();
    
  Axel os((char *)"AlgebraicCurve.axl");
  //os <<tp;// graph + singlular points
  os << tp.m_graph; // graph only

  print_boxes(os,tp.m_leaves) ;

  os.view();
 
  return EXIT_SUCCESS ;
}